Skip to content

Commit 3068c3b

Browse files
linted and updated
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent 8479296 commit 3068c3b

File tree

4 files changed

+11
-7
lines changed

4 files changed

+11
-7
lines changed

sdk/python/feast/inference.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
from feast.infra.offline_stores.file_source import FileSource
1414
from feast.infra.offline_stores.redshift_source import RedshiftSource
1515
from feast.infra.offline_stores.snowflake_source import SnowflakeSource
16+
from feast.on_demand_feature_view import OnDemandFeatureView
1617
from feast.repo_config import RepoConfig
1718
from feast.stream_feature_view import StreamFeatureView
18-
from feast.on_demand_feature_view import OnDemandFeatureView
1919
from feast.types import String
2020
from feast.value_type import ValueType
2121

@@ -257,6 +257,8 @@ def _infer_features_and_entities(
257257
if field.name not in [feature.name for feature in fv.features]:
258258
fv.features.append(field)
259259

260+
fv.entity_columns = entity_columns
261+
260262

261263
def _infer_on_demand_features_and_entities(
262264
fv: OnDemandFeatureView,

sdk/python/feast/on_demand_feature_view.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import inspect
44
import warnings
55
from types import FunctionType
6-
from typing import Any, Optional, Union, get_type_hints, List
6+
from typing import Any, List, Optional, Union, get_type_hints
77

88
import dill
99
import pandas as pd

sdk/python/tests/unit/local_feast_tests/test_local_feature_store.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,9 @@ def test_apply_dummy_entity_and_feature_view_columns(test_feature_store):
392392

393393
# Register Feature View
394394
test_feature_store.apply([e1, fv_no_entity, fv_with_entity])
395-
fv_from_online_store = test_feature_store.get_feature_view("my_feature_view_no_entity")
395+
fv_from_online_store = test_feature_store.get_feature_view(
396+
"my_feature_view_no_entity"
397+
)
396398

397399
# Note that after the apply() the feature_view serializes the Dummy Entity ID
398400
assert fv_no_entity.entity_columns[0].name == DUMMY_ENTITY_ID

sdk/python/tests/unit/test_on_demand_python_transformation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,15 @@ def python_view(inputs: dict[str, Any]) -> dict[str, Any]:
380380
self.store.apply(
381381
[driver, driver_stats_source, driver_stats_fv, python_view]
382382
)
383-
self.store.write_to_online_store(
384-
feature_view_name="driver_hourly_stats", df=driver_df
385-
)
386-
387383
fv_applied = self.store.get_feature_view("driver_hourly_stats")
388384
assert fv_applied.entities == [driver.name]
389385
# Note here that after apply() is called, the entity_columns are populated with the join_key
390386
assert fv_applied.entity_columns[0].name == driver.join_key
391387

388+
self.store.write_to_online_store(
389+
feature_view_name="driver_hourly_stats", df=driver_df
390+
)
391+
392392
def test_python_transformation_returning_all_data_types(self):
393393
entity_rows = [
394394
{

0 commit comments

Comments
 (0)