Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion python/semantic_kernel/connectors/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def _add_key(self, key: TKey, record: dict[str, Any]) -> dict[str, Any]:

@override
async def _inner_delete(self, keys: Sequence[str], **kwargs: Any) -> None:
await asyncio.gather(*[self.redis_database.json().delete(key, **kwargs) for key in keys])
await asyncio.gather(*[self.redis_database.json().delete(self._get_redis_key(key), **kwargs) for key in keys])

@override
def _serialize_dicts_to_store_models(
Expand Down
11 changes: 11 additions & 0 deletions python/tests/unit/connectors/memory/test_redis_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,17 @@ async def test_delete(collection_hash, collection_json, type_):
await collection._inner_delete(["id1"])


@mark.parametrize("type_", ["hash", "json"])
async def test_delete_with_prefix(request, type_):
collection = request.getfixturevalue(f"collection_with_prefix_{type_}")
mock_delete = request.getfixturevalue(f"mock_delete_{type_}")

await collection._inner_delete(["id1"])

# Verify the collection-name prefix was applied to the key
mock_delete.assert_called_once_with("test:id1")


async def test_collection_exists(collection_hash, mock_collection_exists):
await collection_hash.collection_exists()

Expand Down
Loading