Skip to content

Commit

Permalink
fix: Fix Feast UI parser to work with new APIs (#2668)
Browse files Browse the repository at this point in the history
* fix: Fix Feast UI parser to work with new APIs

Signed-off-by: Danny Chiao <danny@tecton.ai>

* more fixes

Signed-off-by: Danny Chiao <danny@tecton.ai>

* fix workflow

Signed-off-by: Danny Chiao <danny@tecton.ai>
  • Loading branch information
adchia authored May 11, 2022
1 parent f775d2e commit 8d76751
Show file tree
Hide file tree
Showing 13 changed files with 515 additions and 642 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '17.x'
registry-url: 'https://registry.npmjs.org'
uses: actions/setup-node@v2
with:
node-version: '17.x'
registry-url: 'https://registry.npmjs.org'
- name: Build wheels
uses: pypa/cibuildwheel@v2.4.0
env:
Expand Down
26 changes: 8 additions & 18 deletions ui/feature_repo/features.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
from datetime import timedelta

from feast import (
Bool,
Entity,
FeatureService,
FeatureView,
Field,
FileSource,
Int64,
String,
ValueType,
)
from feast.data_source import RequestSource
from feast.request_feature_view import RequestFeatureView
from feast.on_demand_feature_view import on_demand_feature_view
from feast.field import Field
from feast.types import Bool, Int64, String
import pandas as pd

zipcode = Entity(
name="zipcode",
value_type=ValueType.INT64,
description="A zipcode",
labels={"owner": "danny@tecton.ai", "team": "hack week",},
tags={"owner": "danny@tecton.ai", "team": "hack week",},
)

zipcode_source = FileSource(
Expand All @@ -43,7 +40,7 @@
Field(name="population", dtype=Int64),
Field(name="total_wages", dtype=Int64),
],
batch_source=zipcode_source,
source=zipcode_source,
tags={
"date_added": "2022-02-7",
"experiments": "experiment-A,experiment-B,experiment-C",
Expand All @@ -64,7 +61,7 @@
Field(name="population", dtype=Int64),
Field(name="total_wages", dtype=Int64),
],
batch_source=zipcode_source,
source=zipcode_source,
tags={
"date_added": "2022-02-7",
"experiments": "experiment-A,experiment-B,experiment-C",
Expand All @@ -81,7 +78,7 @@
Field(name="tax_returns_filed", dtype=Int64),
Field(name="total_wages", dtype=Int64),
],
batch_source=zipcode_source,
source=zipcode_source,
tags={
"date_added": "2022-02-7",
"experiments": "experiment-A,experiment-B,experiment-C",
Expand All @@ -94,7 +91,7 @@
name="dob_ssn",
value_type=ValueType.STRING,
description="Date of birth and last four digits of social security number",
labels={"owner": "tony@tecton.ai", "team": "hack week",},
tags={"owner": "tony@tecton.ai", "team": "hack week",},
)

credit_history_source = FileSource(
Expand All @@ -119,7 +116,7 @@
Field(name="missed_payments_6m", dtype=Int64),
Field(name="bankruptcies", dtype=Int64),
],
batch_source=credit_history_source,
source=credit_history_source,
tags={
"date_added": "2022-02-6",
"experiments": "experiment-A",
Expand Down Expand Up @@ -152,16 +149,10 @@ def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
)
return df


# Define request feature view
transaction_request_fv = RequestFeatureView(
name="transaction_request_fv", request_data_source=input_request,
)

model_v1 = FeatureService(
name="credit_score_v1",
features=[
credit_history[["mortgage_due", "credit_card_due", "missed_payments_1y"]],
credit_history[["credit_card_due", "missed_payments_1y"]],
zipcode_features,
],
tags={"owner": "tony@tecton.ai", "stage": "staging"},
Expand All @@ -173,7 +164,6 @@ def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
features=[
credit_history[["mortgage_due", "credit_card_due", "missed_payments_1y"]],
zipcode_features,
transaction_request_fv,
],
tags={"owner": "tony@tecton.ai", "stage": "prod"},
description="Credit scoring model",
Expand Down
Loading

0 comments on commit 8d76751

Please sign in to comment.