Skip to content

Commit

Permalink
Move apply(dummy_entity) to apply time to ensure it persists in Featu…
Browse files Browse the repository at this point in the history
…reStore (#1848)

Signed-off-by: Cody Lin <[email protected]>
  • Loading branch information
codyjlin authored Sep 9, 2021
1 parent cc74b10 commit 3f4ef09
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ def __init__(
repo_path=self.repo_path,
cache_ttl=timedelta(seconds=registry_config.cache_ttl_seconds),
)
DUMMY_ENTITY = Entity(
name=DUMMY_ENTITY_NAME,
join_key=DUMMY_ENTITY_ID,
value_type=ValueType.INT32,
)
self.apply(DUMMY_ENTITY)

@log_exceptions
def version(self) -> str:
Expand Down Expand Up @@ -412,6 +406,14 @@ def apply(
) + len(odfvs_to_update) != len(objects):
raise ValueError("Unknown object type provided as part of apply() call")

# DUMMY_ENTITY is a placeholder entity used in entityless FeatureViews
DUMMY_ENTITY = Entity(
name=DUMMY_ENTITY_NAME,
join_key=DUMMY_ENTITY_ID,
value_type=ValueType.INT32,
)
entities_to_update.append(DUMMY_ENTITY)

for view in views_to_update:
self._registry.apply_feature_view(view, project=self.project, commit=False)
for odfv in odfvs_to_update:
Expand Down

0 comments on commit 3f4ef09

Please sign in to comment.