From d56d202686cd289cd221aea1f6ea7072801b05c1 Mon Sep 17 00:00:00 2001 From: Zach <54722467+zabarn@users.noreply.github.com> Date: Fri, 1 Nov 2024 17:16:04 -0500 Subject: [PATCH] fix: Remove update_infra from Expedia provider (#152) * fix: Remove update_infra from Expedia provider * fix: default full_scan_for_deletion to false * fix: lint error * fix: default online_config * fix: lint formatting * fix: address comments * fix: lint formatting * fix: docstring test * fix: remove broken coloring from logs * fix: add print statements back * fix: log microseconds during materialization * fix: update logger message --- .../feast/expediagroup/provider/expedia.py | 27 +------------------ sdk/python/feast/feature_store.py | 6 +++++ sdk/python/feast/repo_config.py | 5 ++++ 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/sdk/python/feast/expediagroup/provider/expedia.py b/sdk/python/feast/expediagroup/provider/expedia.py index b242e00437..dc9fed9d49 100644 --- a/sdk/python/feast/expediagroup/provider/expedia.py +++ b/sdk/python/feast/expediagroup/provider/expedia.py @@ -1,9 +1,8 @@ import logging -from typing import List, Sequence, Set +from typing import List, Set import pandas as pd -from feast.entity import Entity from feast.feature_view import FeatureView from feast.infra.passthrough_provider import PassthroughProvider from feast.repo_config import RepoConfig @@ -59,27 +58,3 @@ def ingest_df( ) super().ingest_df(feature_view, df.drop(drop_list, axis=1)) - - def update_infra( - self, - project: str, - tables_to_delete: Sequence[FeatureView], - tables_to_keep: Sequence[FeatureView], - entities_to_delete: Sequence[Entity], - entities_to_keep: Sequence[Entity], - partial: bool, - ): - if self.online_store: - 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" - ) - - if self.batch_engine: - self.batch_engine.update( - project, - tables_to_delete, - tables_to_keep, - entities_to_delete, - entities_to_keep, - ) diff --git a/sdk/python/feast/feature_store.py b/sdk/python/feast/feature_store.py index 44d7242bd0..225c9f5dea 100644 --- a/sdk/python/feast/feature_store.py +++ b/sdk/python/feast/feature_store.py @@ -1288,6 +1288,9 @@ def materialize_incremental( f" from {Style.BRIGHT + Fore.GREEN}{start_date.replace(microsecond=0).astimezone()}{Style.RESET_ALL}" f" to {Style.BRIGHT + Fore.GREEN}{end_date.replace(microsecond=0).astimezone()}{Style.RESET_ALL}:" ) + logger.info( + f"Materializing {feature_view.name} from {start_date.astimezone()} to {end_date.astimezone()}" + ) def tqdm_builder(length): return tqdm(total=length, ncols=100) @@ -1363,6 +1366,9 @@ def materialize( for feature_view in feature_views_to_materialize: provider = self._get_provider() print(f"{Style.BRIGHT + Fore.GREEN}{feature_view.name}{Style.RESET_ALL}:") + logger.info( + f"Materializing {feature_view.name} from {start_date.astimezone()} to {end_date.astimezone()}" + ) def tqdm_builder(length): return tqdm(total=length, ncols=100) diff --git a/sdk/python/feast/repo_config.py b/sdk/python/feast/repo_config.py index ad8d62955e..fe1d63df40 100644 --- a/sdk/python/feast/repo_config.py +++ b/sdk/python/feast/repo_config.py @@ -243,6 +243,11 @@ def __init__(self, **data: Any): self._online_store = None if provider == "expedia": self.online_config = data.get("online_store", "redis") + if ( + isinstance(self.online_config, Dict) + and self.online_config["type"] == "redis" + ): + self.online_config["full_scan_for_deletion"] = False else: self.online_config = data.get("online_store", "sqlite")