Skip to content

Commit 53de535

Browse files
committed
fix: Fix Feast UI failure with new way of specifying entities
Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 3256952 commit 53de535

2 files changed

Lines changed: 7 additions & 18 deletions

File tree

ui/feature_repo/features.py

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

3-
from feast import (
4-
Entity,
5-
FeatureService,
6-
FeatureView,
7-
Field,
8-
FileSource,
9-
ValueType,
10-
)
3+
import pandas as pd
4+
5+
from feast import Entity, FeatureService, FeatureView, Field, FileSource, ValueType
116
from feast.data_source import RequestSource
12-
from feast.request_feature_view import RequestFeatureView
137
from feast.on_demand_feature_view import on_demand_feature_view
148
from feast.types import Bool, Int64, String
15-
import pandas as pd
169

1710
zipcode = Entity(
1811
name="zipcode",
@@ -128,19 +121,14 @@
128121
# Define a request data source which encodes features / information only
129122
# available at request time (e.g. part of the user initiated HTTP request)
130123
input_request = RequestSource(
131-
name="transaction",
132-
schema=[
133-
Field(name="transaction_amt", dtype=Int64),
134-
],
124+
name="transaction", schema=[Field(name="transaction_amt", dtype=Int64),],
135125
)
136126

137127
# Define an on demand feature view which can generate new features based on
138128
# existing feature views and RequestSource features
139129
@on_demand_feature_view(
140130
sources=[credit_history, input_request],
141-
schema=[
142-
Field(name="transaction_gt_last_credit_card_due", dtype=Bool),
143-
],
131+
schema=[Field(name="transaction_gt_last_credit_card_due", dtype=Bool),],
144132
)
145133
def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
146134
df = pd.DataFrame()
@@ -149,6 +137,7 @@ def transaction_gt_last_credit_card_due(inputs: pd.DataFrame) -> pd.DataFrame:
149137
)
150138
return df
151139

140+
152141
model_v1 = FeatureService(
153142
name="credit_score_v1",
154143
features=[

ui/src/parsers/feastEntities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FEAST_FEATURE_VALUE_TYPES } from "./types";
44
const FeastEntitySchema = z.object({
55
spec: z.object({
66
name: z.string(),
7-
valueType: z.nativeEnum(FEAST_FEATURE_VALUE_TYPES),
7+
valueType: z.nativeEnum(FEAST_FEATURE_VALUE_TYPES).optional(),
88
joinKey: z.string(),
99
description: z.string().optional(),
1010
labels: z.record(z.string()).optional(),

0 commit comments

Comments
 (0)