From 0ec3cc7ec4aac40fbe389d24cb52b3d591a868d0 Mon Sep 17 00:00:00 2001 From: Jiwon Park Date: Thu, 9 May 2024 16:43:32 +0900 Subject: [PATCH 1/2] feat: Set optional full-scan for deletion Signed-off-by: Jiwon Park --- 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 6f6c2fb45c..451763ae42 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] = False + """(Optional) whether to scan for deletion of features""" + class RedisOnlineStore(OnlineStore): """ @@ -160,9 +163,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, From 38d70d1a394ce17a87ec51f782dbb0fad7384546 Mon Sep 17 00:00:00 2001 From: Jiwon Park Date: Fri, 24 May 2024 07:59:27 +0900 Subject: [PATCH 2/2] fix: Set default to True for backwards compatibility Signed-off-by: Jiwon Park --- sdk/python/feast/infra/online_stores/redis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/feast/infra/online_stores/redis.py b/sdk/python/feast/infra/online_stores/redis.py index 451763ae42..61e1e9d896 100644 --- a/sdk/python/feast/infra/online_stores/redis.py +++ b/sdk/python/feast/infra/online_stores/redis.py @@ -77,7 +77,7 @@ 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] = False + full_scan_for_deletion: Optional[bool] = True """(Optional) whether to scan for deletion of features"""