Skip to content

Commit

Permalink
fix: Support for feature view deletes using Expedia provider (#101)
Browse files Browse the repository at this point in the history
* fix: Support for feature view deletes using Expedia provider

---------

Co-authored-by: Bhargav Dodla <bdodla@expediagroup.com>
  • Loading branch information
EXPEbdodla and Bhargav Dodla authored Apr 22, 2024
1 parent 54ea08b commit 4996dca
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion sdk/python/feast/expediagroup/provider/expedia.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import logging
from typing import List, Set
from typing import List, Sequence, 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
from feast.stream_feature_view import StreamFeatureView
from feast.usage import set_usage_attribute

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -58,3 +60,29 @@ 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,
):
set_usage_attribute("provider", self.__class__.__name__)

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,
)

0 comments on commit 4996dca

Please sign in to comment.