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: Entityless fv breaks with KeyError: __dummy applying feature_store.plan() on python #3640

Merged
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
14 changes: 10 additions & 4 deletions sdk/python/feast/inference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import re
from typing import List, Set, Union
from typing import List, Optional, Set, Union

from feast.data_source import DataSource, PushSource, RequestSource
from feast.entity import Entity
Expand Down Expand Up @@ -119,7 +119,10 @@ def update_feature_views_with_inferred_features_and_entities(

for fv in fvs:
join_keys = set(
[entity_name_to_join_key_map[entity_name] for entity_name in fv.entities]
[
entity_name_to_join_key_map.get(entity_name)
for entity_name in fv.entities
]
)

# Fields whose names match a join key are considered to be entity columns; all
Expand All @@ -137,7 +140,10 @@ def update_feature_views_with_inferred_features_and_entities(

# Respect the `value_type` attribute of the entity, if it is specified.
for entity_name in fv.entities:
entity = entity_name_to_entity_map[entity_name]
entity = entity_name_to_entity_map.get(entity_name)
# pass when entity does not exist. Entityless feature view case
if entity is None:
continue
if (
entity.join_key
not in [entity_column.name for entity_column in fv.entity_columns]
Expand Down Expand Up @@ -181,7 +187,7 @@ def update_feature_views_with_inferred_features_and_entities(

def _infer_features_and_entities(
fv: FeatureView,
join_keys: Set[str],
join_keys: Set[Optional[str]],
run_inference_for_features,
config,
) -> None:
Expand Down