diff --git a/sdk/python/feast/infra/online_stores/redis.py b/sdk/python/feast/infra/online_stores/redis.py index 6f6c2fb45c6..61e1e9d896b 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): """ @@ -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,