Skip to content

fix: apply Redis JSON collection key prefixes on delete - #14314

Open
medimedi (medisean) wants to merge 1 commit into
microsoft:mainfrom
medisean:codex/fix-redis-json-delete-prefix
Open

fix: apply Redis JSON collection key prefixes on delete#14314
medimedi (medisean) wants to merge 1 commit into
microsoft:mainfrom
medisean:codex/fix-redis-json-delete-prefix

Conversation

@medisean

Copy link
Copy Markdown

Closes#13904

RedisJsonCollection._inner_delete now resolves keys through the same collection-prefix helper used by upsert and get. This prevents deletes from silently targeting the unprefixed key when prefix_collection_name_to_key_names=True, with a regression test for the prefixed JSON collection.

Validation:

  • python3 -m compileall -q python/semantic_kernel/connectors/redis.py python/tests/unit/connectors/memory/test_redis_store.py
  • git diff --check
  • The targeted pytest could not run locally because the environment is missing opentelemetry.

@medisean
medimedi (medisean) marked this pull request as ready for review August 23, 2026 08:44
@medisean
medimedi (medisean) requested a review from a team as a code ownerAugust 23, 2026 08:44
CopilotAI lite review requested due to automatic review settings August 23, 2026 08:44

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes Redis JSON collection deletion when collection-name key prefixes are enabled.

Changes:

  • Applies collection key prefixes during JSON deletion.
  • Adds a regression test for prefixed keys.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

FileSummary
python/tests/unit/connectors/memory/test_redis_store.pyVerifies prefixed JSON deletion behavior.
python/semantic_kernel/connectors/redis.pyPrefixes keys during JSON deletion.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actionsgithub-actionsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

MAF Automated Review — Iteration 1

Result: No findings
Scope: full PR (1 commit(s)): c5352c557478
Model:claude-opus-4.8

Overview

This is a minimal, well-scoped bug fix that routes each delete key in RedisJsonCollection._inner_delete through _get_redis_key, so deletes target the same prefixed key that upsert writes and get reads when prefix_collection_name_to_key_names=True. The change makes the JSON delete path consistent with the JSON upsert/get paths and with the sibling RedisHashsetCollection._inner_delete, which already applied the prefix. The default (prefix=False) case is unaffected because _get_redis_key is a no-op there, callers always pass raw keys so there is no double-prefixing, and a targeted regression test pins the prefixed key. No Critical, High, or Medium defect was established.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.

Sign up for freeto 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.

Python: Bug: RedisJsonCollection.delete() silently fails when prefix_collection_name_to_key_names is enabled

2 participants

@medisean