Skip to content

Commit

Permalink
simplifies drop_keys method
Browse files Browse the repository at this point in the history
  • Loading branch information
justin-cechmanek committed Jul 11, 2024
1 parent 45c5e9f commit 1499bfb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions redisvl/index/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,7 @@ def drop_keys(self, keys: Union[str, List[str]]) -> None:
keys (Union[str, List[str]]): The document ID or IDs to remove from the index.
"""
if isinstance(keys, List):
with self._redis_client.pipeline(transaction=False) as pipe: # type: ignore
for key in keys: # type: ignore
pipe.delete(key)
pipe.execute()
self._redis_client.delete(*keys) # type: ignore
else:
self._redis_client.delete(keys) # type: ignore

Expand Down

0 comments on commit 1499bfb

Please sign in to comment.