Skip to content
Prev Previous commit
Next Next commit
Lint
Signed-off-by: Kevin Zhang <kzhang@tecton.ai>
  • Loading branch information
kevjumba committed Apr 13, 2022
commit f91d9bd2546e068f0c796a14b9b64a8725188429
4 changes: 3 additions & 1 deletion sdk/python/feast/on_demand_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ def get_request_data_schema(self) -> Dict[str, ValueType]:
elif isinstance(request_source.schema, Dict):
Comment thread
kevjumba marked this conversation as resolved.
Outdated
schema.update(request_source.schema)
else:
raise Exception(f"Request source schema is not correct type: ${str(type(request_source.schema))}")
raise Exception(
f"Request source schema is not correct type: ${str(type(request_source.schema))}"
)
return schema

def get_transformed_features_df(
Expand Down
11 changes: 5 additions & 6 deletions sdk/python/tests/integration/registration/test_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,19 +224,18 @@ def test_view_with_missing_feature(features_df: pd.DataFrame) -> pd.DataFrame:
with pytest.raises(SpecifiedFeaturesNotPresentError):
test_view_with_missing_feature.infer_features()

#TODO(kevjumba): remove this in feast 0.23 when deprecating

# TODO(kevjumba): remove this in feast 0.23 when deprecating
@pytest.mark.parametrize(
"request_source_schema", [
"request_source_schema",
[
[Field(name="some_date", dtype=PrimitiveFeastType.UNIX_TIMESTAMP)],
{"some_date": ValueType.UNIX_TIMESTAMP},
],
)
def test_datasource_inference(request_source_schema):
# Create Feature Views
date_request = RequestSource(
name="date_request",
schema=request_source_schema,
)
date_request = RequestSource(name="date_request", schema=request_source_schema,)

@on_demand_feature_view(
# Note: we deliberately use positional arguments here to test that they work correctly,
Expand Down
10 changes: 4 additions & 6 deletions sdk/python/tests/integration/registration/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,10 @@ def test_apply_feature_view_success(test_registry):
@pytest.mark.parametrize(
"test_registry", [lazy_fixture("local_registry")],
)
#TODO(kevjumba): remove this in feast 0.23 when deprecating
# TODO(kevjumba): remove this in feast 0.23 when deprecating
@pytest.mark.parametrize(
"request_source_schema", [
"request_source_schema",
[
[Field(name="my_input_1", dtype=PrimitiveFeastType.INT32)],
{"my_input_1": ValueType.INT32},
],
Expand All @@ -253,10 +254,7 @@ def test_modify_feature_views_success(test_registry, request_source_schema):
created_timestamp_column="timestamp",
)

request_source = RequestSource(
name="request_source",
schema=request_source_schema,
)
request_source = RequestSource(name="request_source", schema=request_source_schema,)

fv1 = FeatureView(
name="my_feature_view_1",
Expand Down