Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Adding Time Series Multiple Aggregators support#4035

Merged
petyaslavova merged 2 commits into
masterfrom
ps_add_ts_multi_aggregators
Apr 21, 2026
Merged

Adding Time Series Multiple Aggregators support#4035
petyaslavova merged 2 commits into
masterfrom
ps_add_ts_multi_aggregators

Conversation

@petyaslavova

@petyaslavova petyaslavova commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

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, and mrevrange commands, as introduced in Redis 8.8.
Previously, these commands only accepted a single aggregation_type parameter.
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_type parameter 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 for range, revrange, mrange, and mrevrange.


Note

Medium Risk
Extends TS.RANGE/TS.MRANGE family 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_type to be a list[str] in TS.RANGE, TS.REVRANGE, TS.MRANGE, and TS.MREVRANGE, serializing lists as a comma-separated AGGREGATION argument.

Updates response parsing so range samples can contain multiple float values per timestamp, and introduces validation that forbids GROUPBY when more than one aggregator is specified. Sync and asyncio test suites add coverage for multi-aggregator queries and the GROUPBY error case.

Reviewed by Cursor Bugbot for commit e93d536. Bugbot is set up for automated code reviews on this repo. Configure here.

@jit-ci

jit-ci Bot commented Apr 16, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@petyaslavova petyaslavova marked this pull request as ready for review April 20, 2026 16:19
@petyaslavova petyaslavova merged commit 5681ed0 into master Apr 21, 2026
412 of 417 checks passed
@petyaslavova petyaslavova deleted the ps_add_ts_multi_aggregators branch April 21, 2026 08:14
@petyaslavova petyaslavova added the feature New feature label Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants