Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve parsing of XINFO STREAM response #3282

Merged
merged 7 commits into from
Jun 18, 2024
Merged

Conversation

Wh1isper
Copy link
Contributor

@Wh1isper Wh1isper commented Jun 16, 2024

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)?
  • Was the change added to CHANGES file?

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

Description of change

Please provide a description of the change here.

closes: #3065

And also fix when there is no group(data["groups"] == []) and parse consumer by defualt

@Wh1isper
Copy link
Contributor Author

Wh1isper commented Jun 16, 2024

This is a tiny fix, I can add test cases and changelogs for this if needed

@gerzse
Copy link
Collaborator

gerzse commented Jun 17, 2024

This is a tiny fix, I can add test cases and changelogs for this if needed

Thanks @Wh1isper

It would be great if you can add tests, one with a response before XTRIM, one for a response after XTRIM.

@Wh1isper Wh1isper changed the title Fix xinfo parse error when no entry or no gropu Fix xinfo_stream(full) parse error when no entry or no group and parse consumer as well Jun 17, 2024
@Wh1isper
Copy link
Contributor Author

@gerzse I've added test code for this change on the original xinfo_stream and xinfo_stream_full test cases, please take a look

CI: https://github.com/Wh1isper/redis-py/actions/runs/9544241170

@gerzse
Copy link
Collaborator

gerzse commented Jun 18, 2024

Thanks for the tests @Wh1isper

@gerzse gerzse merged commit 017f767 into redis:master Jun 18, 2024
46 checks passed
@gerzse gerzse added the bug Bug label Jun 20, 2024
@gerzse gerzse changed the title Fix xinfo_stream(full) parse error when no entry or no group and parse consumer as well Improve parsing of XINFO STREAM response Jun 20, 2024
gerzse pushed a commit to gerzse/redis-py that referenced this pull request Jul 11, 2024
Make the parsing of XINFO STREAM response more resilient, by
handling the case when first and last entries are None after XTRIM.

Improve the parsing of consumers related info.
gerzse pushed a commit that referenced this pull request Jul 11, 2024
Make the parsing of XINFO STREAM response more resilient, by
handling the case when first and last entries are None after XTRIM.

Improve the parsing of consumers related info.
agnesnatasya pushed a commit to agnesnatasya/redis-py that referenced this pull request Jul 20, 2024
Make the parsing of XINFO STREAM response more resilient, by
handling the case when first and last entries are None after XTRIM.

Improve the parsing of consumers related info.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

xinfo_stream IndexError: list index out of range
2 participants