Repository navigation
fix(python): apply collection name prefix to keys in RedisJsonCollection._inner_delete (#13904) - #14852
Open
Parchuri Poojith Kumar (poojithparchuri-iiitk) wants to merge 1 commit into
Conversation
…ion._inner_delete (microsoft#13904)
Parchuri Poojith Kumar (poojithparchuri-iiitk)
requested a review
from a team
as a code owner
November 21, 2026 16:55
Parchuri Poojith Kumar (poojithparchuri-iiitk)
temporarily deployed
to
github-app-auth
November 21, 2026 16:55 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change making Redis JSON deletion honor collection-name prefixes.
No open issues 🎉
What changed in this PR
Fixes #13904 by making Redis JSON deletion honor collection-name prefixes, matching the existing key handling used by other operations.
Changes:
- Applies
_get_redis_key()to each key before issuing JSON delete commands. - Adds a parameterized regression test verifying prefixed delete keys for both hashset and JSON collections.
| File | Description |
|---|---|
python/tests/unit/connectors/memory/test_redis_store.py |
Adds prefixed-key deletion assertions for both collection types. |
python/semantic_kernel/connectors/redis.py |
Uses the configured key prefix when deleting JSON records. |
Review effort: Balanced
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #13904
In
RedisJsonCollection, whenprefix_collection_name_to_key_names=True, records are upserted with a collection prefix (e.g.{collection_name}:{key}). However,_inner_deletewas passing barekeydirectly toself.redis_database.json().delete(key)instead of callingself._get_redis_key(key).As a result, delete operations were targeting non-existent bare keys, returning 0, and silently failing to remove the record.
Changes
python/semantic_kernel/connectors/redis.py:RedisJsonCollection._inner_deleteto callself._get_redis_key(key)for each key, aligning its behavior withRedisHashsetCollection._inner_delete.python/tests/unit/connectors/memory/test_redis_store.py:test_delete_with_prefixparameterized across bothhashsetandjsonto verify thatself._get_redis_key(key)(e.g."test:id1") is properly passed to the underlying redis command.Testing
pytest tests/unit/connectors/memory/test_redis_store.pylocally — all 31 unit tests passed in 3.56s.