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

Move apply(dummy_entity) to apply time to ensure it persists in FeatureStore #1848

Merged
merged 1 commit into from
Sep 9, 2021
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: 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