Skip to content

Commit

Permalink
fix materialization/registration logic
Browse files Browse the repository at this point in the history
  • Loading branch information
zabarn committed Oct 16, 2024
1 parent efd3835 commit 7da2b5b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
11 changes: 11 additions & 0 deletions sdk/python/feast/expediagroup/provider/expedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,19 @@ def update_infra(
entities_to_delete: Sequence[Entity],
entities_to_keep: Sequence[Entity],
partial: bool,
materialization_update: bool = False,
):
if self.online_store:
if self.online_store.type == "scylladb" and materialization_update:
self.online_store.update(
config=self.repo_config,
tables_to_delete=tables_to_delete,
tables_to_keep=tables_to_keep,
entities_to_keep=entities_to_keep,
entities_to_delete=entities_to_delete,
partial=partial,
)

if tables_to_delete:
logger.info(
f"Data associated to {[feature_view.name for feature_view in tables_to_delete]} feature views will be deleted from the online store based on ttl defined if the entities are not shared with other feature views"
Expand Down
6 changes: 4 additions & 2 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ def materialize_incremental(
feature_views
)

if getattr(self.config.online_store, "lazy_table_creation", False):
if getattr(self.config.online_store, "lazy_table_creation", False) and self.config.provider == "expedia":
# feature_views_to_delete = self._get_feature_views_to_delete()
# don't delete any tables for now

Expand All @@ -1267,6 +1267,7 @@ def materialize_incremental(
entities_to_delete=[],
entities_to_keep=[],
partial=True,
materialization_update=True,
)

_print_materialization_log(
Expand Down Expand Up @@ -1365,7 +1366,7 @@ def materialize(
feature_views
)

if getattr(self.config.online_store, "lazy_table_creation", False):
if getattr(self.config.online_store, "lazy_table_creation", False) and self.config.provider == "expedia":
# feature_views_to_delete = self._get_feature_views_to_delete()
# don't delete any tables for now

Expand All @@ -1376,6 +1377,7 @@ def materialize(
entities_to_delete=[],
entities_to_keep=[],
partial=True,
materialization_update=True,
)

_print_materialization_log(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,6 @@ def update(
"""
project = config.project

if getattr(config.online_store, "lazy_table_creation", False):
logger.info(
f"Lazy table creation enabled. Skipping table creation for {project} online store."
)
# create tables during materialization
return

for table in tables_to_keep:
self._create_table(config, project, table)
for table in tables_to_delete:
Expand Down

0 comments on commit 7da2b5b

Please sign in to comment.