Skip to content

Add TS.NRANGE and TS.NREVRANGE Commands#3870

Open
ofekshenawa wants to merge 5 commits into
masterfrom
add-tsnrange-and-tsnrevrange-commands
Open

Add TS.NRANGE and TS.NREVRANGE Commands#3870
ofekshenawa wants to merge 5 commits into
masterfrom
add-tsnrange-and-tsnrevrange-commands

Conversation

@ofekshenawa

@ofekshenawa ofekshenawa commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Adds client support for TS.NRANGE and TS.NREVRANGE, two new RedisTimeSeries commands introduced in Redis 8.10 that query an explicit list of time-series keys and return a timestamp-pivoted table where each row is [timestamp, [value_per_key]].

Changes

  • New result type TSNRangePivotRow with a Values []float64 slice (one entry per input key, NaN for missing samples)
  • New option structs TSNRangeOptions / TSNRevRangeOptions — aggregation takes one Aggregator per key, emitted as separate wire tokens (not comma-joined like existing range commands)
  • 4 new methods on cmdable and TimeseriesCmdable: TSNRange, TSNRangeWithArgs, TSNRevRange, TSNRevRangeWithArgs
  • CI updated to include 8.10.x in the benchmark and test matrices, mapped to redislabs/client-libs-test:8.10-m01-int

Note

Low Risk
New timeseries API and CI matrix expansion; version-skip refactor is mechanical with broad test touch but no runtime client behavior change for existing commands.

Overview
Adds RedisTimeSeries client support for TS.NRANGE and TS.NREVRANGE (Redis 8.10+): pivot rows as TSNRangePivotRow (timestamp + one float64 per key, NaN when missing), option structs with one aggregator per key on the wire (not comma-joined like other range commands), and four cmdable methods with RESP parsing and CmdTypeTSNRangePivotRowSlice in the generic command path.

CI now runs benchmarks and CE tests against 8.10.x, mapping to redislabs/client-libs-test:8.10-m01-int in both run-tests and build.yml.

Test/version gating switches from float RedisVersion comparisons to string major.minor via parseRedisVersionStr, redisVersionAtLeast, and SkipBeforeRedisVersion / SkipAfterRedisVersion taking version strings across the suite (including digest_test.go init).

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit df76924. Configure here.

Comment thread timeseries_commands_test.go Outdated
@jit-ci

jit-ci Bot commented Jun 28, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

@ndyakov ndyakov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a question, other than that looks good. Thank you for fixing the test guards.

Comment thread timeseries_commands.go Outdated
@ofekshenawa ofekshenawa requested a review from ndyakov June 29, 2026 08:00

@ndyakov ndyakov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@ndyakov ndyakov added the wait Can’t be processed temporarily for other reasons label Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wait Can’t be processed temporarily for other reasons

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants