Skip to content

Commit 8d76751

Browse files
authored
fix: Fix Feast UI parser to work with new APIs (#2668)
* fix: Fix Feast UI parser to work with new APIs Signed-off-by: Danny Chiao <[email protected]> * more fixes Signed-off-by: Danny Chiao <[email protected]> * fix workflow Signed-off-by: Danny Chiao <[email protected]>
1 parent f775d2e commit 8d76751

File tree

13 files changed

+515
-642
lines changed

13 files changed

+515
-642
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ jobs:
167167
steps:
168168
- uses: actions/checkout@v2
169169
- name: Setup Node
170-
uses: actions/setup-node@v2
171-
with:
172-
node-version: '17.x'
173-
registry-url: 'https://registry.npmjs.org'
170+
uses: actions/setup-node@v2
171+
with:
172+
node-version: '17.x'
173+
registry-url: 'https://registry.npmjs.org'
174174
- name: Build wheels
175175
uses: pypa/[email protected]
176176
env:

ui/feature_repo/features.py

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
from datetime import timedelta
22

33
from feast import (
4-
Bool,
54
Entity,
65
FeatureService,
76
FeatureView,
87
Field,
98
FileSource,
10-
Int64,
11-
String,
129
ValueType,
1310
)
1411
from feast.data_source import RequestSource
1512
from feast.request_feature_view import RequestFeatureView
1613
from feast.on_demand_feature_view import on_demand_feature_view
17-
from feast.field import Field
14+
from feast.types import Bool, Int64, String
1815
import pandas as pd
1916

2017
zipcode = Entity(
2118
name="zipcode",
2219
value_type=ValueType.INT64,
2320
description="A zipcode",
24-
labels={"owner": "[email protected]", "team": "hack week",},
21+
tags={"owner": "[email protected]", "team": "hack week",},
2522
)
2623

2724
zipcode_source = FileSource(
@@ -43,7 +40,7 @@
4340
Field(name="population", dtype=Int64),
4441
Field(name="total_wages", dtype=Int64),
4542
],
46-
batch_source=zipcode_source,
43+
source=zipcode_source,
4744
tags={
4845
"date_added": "2022-02-7",
4946
"experiments": "experiment-A,experiment-B,experiment-C",
@@ -64,7 +61,7 @@
6461
Field(name="population", dtype=Int64),
6562
Field(name="total_wages", dtype=Int64),
6663
],
67-
batch_source=zipcode_source,
64+
source=zipcode_source,
6865
tags={
6966
"date_added": "2022-02-7",
7067
"experiments": "experiment-A,experiment-B,experiment-C",
@@ -81,7 +78,7 @@
8178
Field(name="tax_returns_filed", dtype=Int64),
8279
Field(name="total_wages", dtype=Int64),
8380
],
84-
batch_source=zipcode_source,
81+
source=zipcode_source,
8582
tags={
8683
"date_added": "2022-02-7",
8784
"experiments": "experiment-A,experiment-B,experiment-C",
@@ -94,7 +91,7 @@
9491
name="dob_ssn",
9592
value_type=ValueType.STRING,
9693
description="Date of birth and last four digits of social security number",
97-
labels={"owner": "[email protected]", "team": "hack week",},
94+
tags={"owner": "[email protected]", "team": "hack week",},
9895
)
9996

10097
credit_history_source = FileSource(
@@ -119,7 +116,7 @@
119116
Field(name="missed_payments_6m", dtype=Int64),
120117
Field(name="bankruptcies", dtype=Int64),
121118
],
122-
batch_source=credit_history_source,
119+
source=credit_history_source,
123120
tags={
124121
"date_added": "2022-02-6",
125122
"experiments": "experiment-A",
@@ -152,16 +149,10 @@ def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
152149
)
153150
return df
154151

155-
156-
# Define request feature view
157-
transaction_request_fv = RequestFeatureView(
158-
name="transaction_request_fv", request_data_source=input_request,
159-
)
160-
161152
model_v1 = FeatureService(
162153
name="credit_score_v1",
163154
features=[
164-
credit_history[["mortgage_due", "credit_card_due", "missed_payments_1y"]],
155+
credit_history[["credit_card_due", "missed_payments_1y"]],
165156
zipcode_features,
166157
],
167158
tags={"owner": "[email protected]", "stage": "staging"},
@@ -173,7 +164,6 @@ def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
173164
features=[
174165
credit_history[["mortgage_due", "credit_card_due", "missed_payments_1y"]],
175166
zipcode_features,
176-
transaction_request_fv,
177167
],
178168
tags={"owner": "[email protected]", "stage": "prod"},
179169
description="Credit scoring model",

0 commit comments

Comments
 (0)