Skip to content

fix(typing): correct type annotation for XReadResponse#4046

Merged
petyaslavova merged 1 commit into
redis:masterfrom
hydroblaze:patch-1
May 26, 2026
Merged

fix(typing): correct type annotation for XReadResponse#4046
petyaslavova merged 1 commit into
redis:masterfrom
hydroblaze:patch-1

Conversation

@hydroblaze
Copy link
Copy Markdown
Contributor

@hydroblaze hydroblaze commented Apr 22, 2026

XReadResponse type is incorrect.

Description of change

unlist the StreamRangeResponse in the value of XReadResponse

Pull Request check-list

Please make sure to review and check all of these items:

  • Do tests and lints pass with this change?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.


Note

Low Risk
Type-only changes to annotations and imports; no runtime command behavior is modified.

Overview
This PR tightens stream read typings so static analysis matches what Redis actually returns.

XREAD (XReadResponse) now allows each stream’s value in the dict form to be a StreamRangeResponse directly, not only list[StreamRangeResponse]—fixing the incorrect extra list wrapper in the type.

XREADGROUP is switched from XReadResponse to a dedicated XReadGroupResponse, with supporting aliases for auto-claim entries (XReadGroupClaimEntry) and per-stream payloads that can be normal stream entries or claim tuples (XReadGroupStreamResponse). Sync/async overloads and the implementation signature in core.py are updated accordingly.

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

@jit-ci
Copy link
Copy Markdown

jit-ci Bot commented Apr 22, 2026

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@petyaslavova
Copy link
Copy Markdown
Collaborator

Hey @hydroblaze, thank you for your contribution! I will have a look at it soon.

Comment thread redis/typing.py Outdated
StreamRangeResponse is already a list type
Copy link
Copy Markdown
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.

LGMT.

@petyaslavova petyaslavova merged commit 28c6b9d into redis:master May 26, 2026
343 checks passed
@petyaslavova petyaslavova added the maintenance Maintenance (CI, Releases, etc) label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Maintenance (CI, Releases, etc)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants