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

Add ability drop all keys from the index #183

Merged
merged 3 commits into from
Jul 17, 2024

Conversation

justin-cechmanek
Copy link
Collaborator

From our chat today I'm pulling out this method from the semantic cache and moving it into index. Rather can modify the clear() method to take an optional list of keys it's a new method.

The goal is to stop the accidental calling of clear() with no args, thinking it will clear no keys, but actually delete everything.

rbs333
rbs333 previously approved these changes Jul 11, 2024
Copy link
Collaborator

@tylerhutcherson tylerhutcherson left a comment

Choose a reason for hiding this comment

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

Looks great -- one small thought about returning the count

@@ -935,6 +945,16 @@ async def clear(self) -> int:

return total_records_deleted

async def drop_keys(self, keys: Union[str, List[str]]) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry one quick thing. delete returns the count of keys dropped. With the clear method, I though it might be valuable to return the count here. Should be easy to do the same

@tylerhutcherson tylerhutcherson changed the title adds drop_keys and async drop_keys methods to index Add ability drop all keys from the index Jul 17, 2024
@tylerhutcherson tylerhutcherson merged commit 75d1473 into main Jul 17, 2024
20 checks passed
@tylerhutcherson tylerhutcherson deleted the feat/RAAE-174/delete-cache-entries branch July 17, 2024 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants