From f2e260a7fe893c56c23c744982e7b7e95e077819 Mon Sep 17 00:00:00 2001 From: Jiwon Park Date: Mon, 27 May 2024 09:15:59 +0900 Subject: [PATCH] feat: Set optional full-scan for deletion (#4189) --- sdk/python/feast/infra/online_stores/redis.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sdk/python/feast/infra/online_stores/redis.py b/sdk/python/feast/infra/online_stores/redis.py index 7428eb8bea..5f0156f620 100644 --- a/sdk/python/feast/infra/online_stores/redis.py +++ b/sdk/python/feast/infra/online_stores/redis.py @@ -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): """ @@ -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,