Adding Time Series Multiple Aggregators support#4035
Merged
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
vladvildanov
approved these changes
Apr 21, 2026
petyaslavova
added a commit
that referenced
this pull request
May 26, 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.
Add support for multiple aggregators in TS.RANGE, TS.REVRANGE, TS.MRANGE, and TS.MREVRANGE
This PR adds support for passing multiple aggregators to the TimeSeries
range,revrange,mrange, andmrevrangecommands, as introduced in Redis 8.8.Previously, these commands only accepted a single
aggregation_typeparameter.With this change, users can now pass a list of aggregation types (e.g.,
["avg", "max"]) to retrieve multiple aggregations in a single call.The existing single-aggregator usage remains fully backward compatible.
Both the sync and async implementations have been updated to ensure full parity.
The
aggregation_typeparameter now accepts either a single string or a list of strings, and the command construction logic correctly serializes multiple aggregators when a list is provided.No public API signatures were broken — existing callers passing a single string will continue to work without any changes.
New tests have been added for both sync (
test_timeseries.py) and async (test_asyncio/test_timeseries.py) covering multi-aggregator scenarios forrange,revrange,mrange, andmrevrange.Note
Medium Risk
Extends
TS.RANGE/TS.MRANGEfamily to accept list-based aggregations and changes parsing to return variable-width samples, which may affect callers that assume a fixed[timestamp, value]shape when opting into the new feature.Overview
Adds RedisTimeSeries multi-aggregator support by allowing
aggregation_typeto be alist[str]inTS.RANGE,TS.REVRANGE,TS.MRANGE, andTS.MREVRANGE, serializing lists as a comma-separatedAGGREGATIONargument.Updates response parsing so range samples can contain multiple float values per timestamp, and introduces validation that forbids
GROUPBYwhen more than one aggregator is specified. Sync and asyncio test suites add coverage for multi-aggregator queries and theGROUPBYerror case.Reviewed by Cursor Bugbot for commit e93d536. Bugbot is set up for automated code reviews on this repo. Configure here.