Repository navigation
Report the reducer in unified TS.MRANGE/MREVRANGE metadata on RESP2 with GROUPBY - #4634
Merged
petyaslavova merged 2 commits intoNov 16, 2026
Conversation
Codex Review Summary: ✅ CompletedThis 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 @astroknot-sheep, thank you for your contribution!
The fix looks good to me: passing reduce to the callback only when groupby is set matches when GROUPBY is actually sent, and the cross-protocol test covers both the plain and the aggregated GROUPBY cases. I'll approve once CI is green.
petyaslavova
approved these changes
Nov 16, 2026
petyaslavova
added a commit
that referenced
this pull request
Nov 16, 2026
…ith GROUPBY (#4634) Co-authored-by: petyaslavova <[email protected]>
Merged
2 of 5 tasks
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
legacy_responses=False, a groupedTS.MRANGE/TS.MREVRANGEreturns different metadata on RESP2 and RESP3. RESP3 sends the metadata,{"reducers": ["sum"]}. RESP2 doesn't send any, soparse_m_range_unifiedbuilds it from the call options, but it only looks ataggregation_type, so it always returns{"aggregators": [...]}:This passes
reduceto the response callback too (only whengroupbyis set), likeaggregation_typealready is, and_m_range_metadatareturns{"reducers": [reduce]}in lower case, the way the server reports it. The RESP3 path doesn't change.Added
test_mrange_groupby_unified_metadata_matches_on_both_protocols, which runs a groupedmrangeandmrevrangeon protocol 2 and 3 and checks both results are the same. It fails on master and passes now.tests/test_timeseries.pyandtests/test_asyncio/test_timeseries.pypass locally with and without--legacy-responses=false(redis-stack-server 7.4.0); ruff is clean.I used an AI assistant while working on this; I reproduced it, reviewed the change and ran the tests myself.
Pull Request check-list
Note
Low Risk
Narrow change to unified TimeSeries response parsing for GROUPBY queries; behavior fix with targeted tests and no API surface change beyond corrected metadata shape.
Overview
With
legacy_responses=False, groupedTS.MRANGE/TS.MREVRANGEreplies now expose the same metadata on RESP2 as on RESP3. RESP2 does not send metadata on the wire, so the client synthesizes it; previously it only usedaggregation_type, producing{"aggregators": [...]}even whenGROUPBY/REDUCEwas used, while RESP3 correctly returned{"reducers": [...]}.mrangeandmrevrangenow forwardreduceinto the response parser whengroupbyis set (mirroringaggregation_type)._m_range_metadataprefersreduceand emits lowercasereducers. A new integration test asserts protocol 2 and 3 match for groupedmrangeandmrevrange.Reviewed by Cursor Bugbot for commit e34bfaa. Bugbot is set up for automated code reviews on this repo. Configure here.