Skip to content

Commit

Permalink
linted and updated
Browse files Browse the repository at this point in the history
Signed-off-by: Francisco Javier Arceo <[email protected]>
  • Loading branch information
franciscojavierarceo committed Sep 25, 2024
1 parent 7cce27d commit fd5beda
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion sdk/python/feast/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
from feast.infra.offline_stores.file_source import FileSource
from feast.infra.offline_stores.redshift_source import RedshiftSource
from feast.infra.offline_stores.snowflake_source import SnowflakeSource
from feast.on_demand_feature_view import OnDemandFeatureView
from feast.repo_config import RepoConfig
from feast.stream_feature_view import StreamFeatureView
from feast.on_demand_feature_view import OnDemandFeatureView
from feast.types import String
from feast.value_type import ValueType

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

fv.entity_columns = entity_columns


def _infer_on_demand_features_and_entities(
fv: OnDemandFeatureView,
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/feast/on_demand_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import inspect
import warnings
from types import FunctionType
from typing import Any, Optional, Union, get_type_hints, List
from typing import Any, List, Optional, Union, get_type_hints

import dill
import pandas as pd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,9 @@ def test_apply_dummy_entity_and_feature_view_columns(test_feature_store):

# Register Feature View
test_feature_store.apply([e1, fv_no_entity, fv_with_entity])
fv_from_online_store = test_feature_store.get_feature_view("my_feature_view_no_entity")
fv_from_online_store = test_feature_store.get_feature_view(
"my_feature_view_no_entity"
)

# Note that after the apply() the feature_view serializes the Dummy Entity ID
assert fv_no_entity.entity_columns[0].name == DUMMY_ENTITY_ID
Expand Down
8 changes: 4 additions & 4 deletions sdk/python/tests/unit/test_on_demand_python_transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@ def python_view(inputs: dict[str, Any]) -> dict[str, Any]:
self.store.apply(
[driver, driver_stats_source, driver_stats_fv, python_view]
)
self.store.write_to_online_store(
feature_view_name="driver_hourly_stats", df=driver_df
)

fv_applied = self.store.get_feature_view("driver_hourly_stats")
assert fv_applied.entities == [driver.name]
# Note here that after apply() is called, the entity_columns are populated with the join_key
assert fv_applied.entity_columns[0].name == driver.join_key

self.store.write_to_online_store(
feature_view_name="driver_hourly_stats", df=driver_df
)

def test_python_transformation_returning_all_data_types(self):
entity_rows = [
{
Expand Down

0 comments on commit fd5beda

Please sign in to comment.