Skip to content

Commit ef4ef32

Browse files
wfoschierawilliamfoschiera
and
williamfoschiera
authored
fix: Entityless fv breaks with KeyError: __dummy applying feature_store.plan() on python (feast-dev#3640)
* fix! KeyError: __dummy on entityless fv Signed-off-by: williamfoschiera <william.foschiera@buser.com.br> * fix! join_keys typing. Signed-off-by: williamfoschiera <william.foschiera@buser.com.br> --------- Signed-off-by: williamfoschiera <william.foschiera@buser.com.br> Co-authored-by: williamfoschiera <william.foschiera@buser.com.br>
1 parent 1c01035 commit ef4ef32

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sdk/python/feast/inference.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import re
2-
from typing import List, Set, Union
2+
from typing import List, Optional, Set, Union
33

44
from feast.data_source import DataSource, PushSource, RequestSource
55
from feast.entity import Entity
@@ -119,7 +119,10 @@ def update_feature_views_with_inferred_features_and_entities(
119119

120120
for fv in fvs:
121121
join_keys = set(
122-
[entity_name_to_join_key_map[entity_name] for entity_name in fv.entities]
122+
[
123+
entity_name_to_join_key_map.get(entity_name)
124+
for entity_name in fv.entities
125+
]
123126
)
124127

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

138141
# Respect the `value_type` attribute of the entity, if it is specified.
139142
for entity_name in fv.entities:
140-
entity = entity_name_to_entity_map[entity_name]
143+
entity = entity_name_to_entity_map.get(entity_name)
144+
# pass when entity does not exist. Entityless feature view case
145+
if entity is None:
146+
continue
141147
if (
142148
entity.join_key
143149
not in [entity_column.name for entity_column in fv.entity_columns]
@@ -181,7 +187,7 @@ def update_feature_views_with_inferred_features_and_entities(
181187

182188
def _infer_features_and_entities(
183189
fv: FeatureView,
184-
join_keys: Set[str],
190+
join_keys: Set[Optional[str]],
185191
run_inference_for_features,
186192
config,
187193
) -> None:

0 commit comments

Comments
 (0)