Skip to content

Commit

Permalink
feat: Set optional full-scan for deletion (#4189)
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-park authored and franciscojavierarceo committed May 27, 2024
1 parent 3df5913 commit f2e260a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sdk/python/feast/infra/online_stores/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class RedisOnlineStoreConfig(FeastConfigBaseModel):
key_ttl_seconds: Optional[int] = None
"""(Optional) redis key bin ttl (in seconds) for expiring entities"""

full_scan_for_deletion: Optional[bool] = True
"""(Optional) whether to scan for deletion of features"""


class RedisOnlineStore(OnlineStore):
"""
Expand Down Expand Up @@ -162,9 +165,13 @@ def update(
entities_to_keep: Entities to keep
partial: Whether to do a partial update
"""
online_store_config = config.online_store

assert isinstance(online_store_config, RedisOnlineStoreConfig)

for table in tables_to_delete:
self.delete_table(config, table)
if online_store_config.full_scan_for_deletion:
for table in tables_to_delete:
self.delete_table(config, table)

def teardown(
self,
Expand Down

0 comments on commit f2e260a

Please sign in to comment.