Repository navigation
Python: Omit null fields from Redis context writes - #9069
Open
LI (ktz03) wants to merge 1 commit into
Open
LI (ktz03) wants to merge 1 commit into
LI (ktz03) wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix preserves non-null data and vectors while comprehensively covering the reported failure.
Review effort: Balanced
Findings: None
What changed in this PR
Aligns injected Redis context indexes with provider-created indexes by omitting null fields before HASH writes.
Changes:
- Removes
Nonevalues after vector generation without mutating caller inputs. - Adds regression coverage for scopes, IDs, placeholders, and vectors.
| File | Description |
|---|---|
python/packages/redis/agent_framework_redis/_context_provider.py |
Filters null fields before RedisVL loading. |
python/packages/redis/tests/test_context_provider_sdk.py |
Tests owned and borrowed index write behavior. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
This branch was successfully 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.
Motivation & Context
An injected Redis context index uses RedisVL's default non-validating load path. Ordinary messages and unset scope fields can contain
None, which Redis HASH encoding rejects. Provider-created indexes already omit these null values through RedisVL validation; writes through supplied indexes should have the same behavior.Description & Review Guide
Nonevalues from the prepared document copies immediately before loading, after embedding generation. Add seven SDK-chain regressions for public message writes, optional scopes and session fields, supplied IDs, null placeholders, and binary/generated vectors.RedisCollectionHASH null validation is unchanged.Related Issue
Fixes #9067
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.