Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Set optional full-scan for deletion #4189

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the old implementation deletes tables by default.
should full_scan_for_deletion's default value be True?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you said, I set default to True for compatibility with older implementations.
If compatibility is not enforced, I think False would be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@breno-costa Changed to default True to ensure backward compatibility

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

def teardown(
self,
Expand Down
Loading