Repository navigation
Honor field encodings in FT.PROFILE search results - #4475
Merged
petyaslavova merged 2 commits intoOct 22, 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
left a comment
Collaborator
There was a problem hiding this comment.
Hey @JackyHsu-X, thank you for your contribution!
The fix matches how FT.SEARCH already passes the return_field encodings, and the live regression covers the relevant protocol and response modes. Looks good to me - I'll merge once CI passes.
petyaslavova
approved these changes
Oct 22, 2026
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.
Description of change
With
decode_responses=False,FT.PROFILEignoresQuery.return_field()encoding settings even thoughFT.SEARCHhonors them. For example,.return_field("vector", decode_field=False)returns a string instead of the original bytes, dropping invalid UTF-8 bytes on the RESP2 path. A field configured withencoding="latin-1"is also decoded incorrectly.Pass the query's field encoding map to the existing result constructors in the RESP2 legacy/unified and RESP3 profile parsers. The regression uses a binary field returned under an alias, a Latin-1 field and an ordinary text field across the default/explicit protocol and response modes,
LIMITED, and scores. Public signatures and the explicit RESP3 legacy native profile shape are unchanged. The docstring clarifies that binary fields requiredecode_responses=False; this does not change transport-level decoding or add an asyncprofile()API.Validation against Redis 8.2.2 / Search 8.2.5 on Windows:
git diff --checkpasses.tests/test_multiprocessing.pycalling the unavailable Windowsforkcontext. Linux, cluster, Enterprise and the full hosted CI matrix have not been run locally.No existing issue or open PR was found for this profile-parser omission. #4025 introduced response unification and is already merged; this fixes the remaining field-encoding propagation in the profile result parsers.
AI assistance: OpenAI Codex investigated, implemented and ran the local checks, and drafted this description.
Pull Request check-list
profile()docstring; no API changes.Note
Low Risk
Parser-only alignment with existing FT.SEARCH behavior; no API or wire-format changes, with targeted regression coverage.
Overview
FT.PROFILE search result parsing now passes the queryβs
Query.return_field()encoding map intoResult/Result.from_resp3, matching FT.SEARCH behavior. Binary fields (decode_field=False) and custom encodings (e.g.latin-1) are decoded correctly on RESP2 legacy/unified and RESP3 profile paths instead of being forced through default UTF-8 handling.The
profile()docstring notes that binary fields requiredecode_responses=Falseandreturn_field(..., decode_field=False). A live-server regression covers protocol,legacy_responses,LIMITED, andwith_scores.Reviewed by Cursor Bugbot for commit 77dda6a. Bugbot is set up for automated code reviews on this repo. Configure here.