Skip to content

Commit

Permalink
fix: Remove update_infra from Expedia provider (#152)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
zabarn authored Nov 1, 2024
1 parent 9b5ae73 commit d56d202
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 26 deletions.
27 changes: 1 addition & 26 deletions sdk/python/feast/expediagroup/provider/expedia.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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,
)
6 changes: 6 additions & 0 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions sdk/python/feast/repo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit d56d202

Please sign in to comment.