Repository navigation
Fix VADD updates with empty attributes - #4430
Merged
petyaslavova merged 4 commits intoOct 15, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
βΉοΈ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with π while any review is running, comments if it has suggestions, and reacts with π once all reviews finish with no findings. |
petyaslavova
approved these changes
Oct 15, 2026
petyaslavova
left a comment
Collaborator
There was a problem hiding this comment.
Hi @Ganesh1729-ui, thank you for your contribution! LGTM.
|
Thanks for reviewing and approving this PR. I appreciate your feedback. |
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.
VADD currently drops an explicit empty dictionary or empty string from
attributes. When updating an existing vector, its previous metadata survives. The equivalent JSON string"{}"already sendsSETATTR.For example, against a local Redis server supporting vector sets:
This affects re-indexing when replacement metadata becomes empty. Discovered through code analysis, then reproduced with command probes and a real Redis 8.10.2 server; no production incident is claimed.
Check
attributes is not Nonein the shared sync/async command builder. This forwards{}asSETATTR '{}'and""as attribute removal, while None still leaves existing attributes unchanged. This follows Redis's VADD contract and its existing server update behavior. Signatures and response callbacks are unchanged.Add sync/async regressions for updates with
{},"{}","", None and a nonempty replacement. The prior empty-dict test adds a new vector, where omission cannot expose stale attributes.Validation:
pytest tests/test_vsets.py tests/test_asyncio/test_vsets.py -q, with Redis 8.10.2 and Python 3.13.16: 147 passed in each RESP2/RESP3 Γ legacy/unified configuration. One unchangedcaptureconfiguration warning per run. Fork validation.invoke linters(Ruff and Vulture), sdistβwheel builds on Windows/Linux, and diff checks pass.The separate fork validation workflow is absent from this three-file contribution. The remaining Redis/Python/parser/event-loop version matrix was not run locally. AI assistance was used for source investigation, implementation, validation and this description.
Note
Low Risk
Small, targeted change to VADD argument encoding with added tests; behavior change only affects callers that pass empty dict/string to clear or reset attributes on update.
Overview
Fixes
vaddso explicit empty or clearing attribute values are sent on updates to an existing element, instead of being dropped and leaving stale metadata.The command builder now uses
attributes is not None(replacing a truthiness check), so{}and"{}"emitSETATTRwith an empty object and""clears attributes, whileNonestill omitsSETATTRand preserves existing attributes. Docstrings describe this behavior.Sync and async regression tests cover re-adding the same element with
{},"{}","",None, and a nonempty replacement.Reviewed by Cursor Bugbot for commit c1b796e. Bugbot is set up for automated code reviews on this repo. Configure here.