Skip to content

Add sorted set examples notebook#3984

Open
Br1an67 wants to merge 2 commits intoredis:masterfrom
Br1an67:docs/sorted-set-examples
Open

Add sorted set examples notebook#3984
Br1an67 wants to merge 2 commits intoredis:masterfrom
Br1an67:docs/sorted-set-examples

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Description of change

Added a Jupyter notebook demonstrating Redis sorted set operations. Covers:

  • Basic ZADD and ZRANGE
  • ZRANGEBYSCORE — range queries by score
  • ZINCRBY — score increments
  • ZRANK / ZREVRANK — rank lookups
  • ZREM — removing members
  • ZUNIONSTORE / ZINTERSTORE — combining sorted sets
  • A practical leaderboard example

Follows the same structure and style as the existing example notebooks.

Pull Request check-list

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change?
  • Is the new or changed code fully tested?
  • Is a documentation update included? — This PR is documentation
  • Is there an example added to the examples folder?

Contributes to #1744


Note

Low Risk
Low risk documentation-only change that adds a new example notebook; no production code paths are modified.

Overview
Adds a new Jupyter notebook docs/examples/sorted_set_examples.ipynb demonstrating Redis sorted set usage via redis-py, including ZADD/ZRANGE, score range queries, score increments, rank lookups, member removal, set union/intersection, and a small leaderboard walkthrough.

Written by Cursor Bugbot for commit 99d34bd. This will update automatically on new commits. Configure here.

Add a Jupyter notebook demonstrating sorted set operations including
ZADD, ZRANGE, ZRANGEBYSCORE, ZINCRBY, ZRANK/ZREVRANK, ZREM, and
ZUNIONSTORE/ZINTERSTORE with a practical leaderboard example.
@Br1an67 Br1an67 mentioned this pull request Mar 1, 2026
@petyaslavova
Copy link
Collaborator

Hi @Br1an67, thank you for your contribution! We will have a look at it.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Jupyter notebook to the documentation examples to demonstrate Redis sorted set usage via redis-py, supporting the broader “add more examples” initiative in #1744.

Changes:

  • Introduces docs/examples/sorted_set_examples.ipynb covering core sorted set commands (ZADD, ZRANGE/ZRANGEBYSCORE, ZINCRBY, ZRANK/ZREVRANK, ZREM, ZUNIONSTORE/ZINTERSTORE)
  • Includes a practical leaderboard walkthrough using sorted sets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +15 to +19
"source": [
"## Connect to Redis\n",
"\n",
"To understand what ```decode_responses=True``` does, refer back to [this document](connection_examples.ipynb)"
]
Copy link

Copilot AI Mar 1, 2026

Choose a reason for hiding this comment

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

This new notebook isn’t referenced anywhere in the documentation TOC, so it likely won’t show up in the rendered docs. docs/examples.rst currently lists each notebook explicitly in its toctree, and sorted_set_examples isn’t included there. Add examples/sorted_set_examples to that toctree so the page is discoverable in the published docs.

Copilot uses AI. Check for mistakes.
@petyaslavova petyaslavova added the maintenance Maintenance (CI, Releases, etc) label Mar 4, 2026
Copy link
Collaborator

@petyaslavova petyaslavova left a comment

Choose a reason for hiding this comment

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

Hey @Br1an67, the notebooks looks good. Can you please add reference to it in the docs/examples.rst

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes-requested maintenance Maintenance (CI, Releases, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants