Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix Feast UI parser to work with new APIs #2668

Merged
merged 3 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]
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": "[email protected]", "team": "hack week",},
tags={"owner": "[email protected]", "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": "[email protected]", "team": "hack week",},
tags={"owner": "[email protected]", "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": "[email protected]", "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": "[email protected]", "stage": "prod"},
description="Credit scoring model",
Expand Down
Loading