Skip to content

Python: add XINFO GROUPS and XINFO CONSUMERS commands - #1753

Merged
acarbonetto merged 5 commits into
valkey-io:mainfrom
Bit-Quill:python/integ_acongo_xinfo_groups
Jul 2, 2024
Merged

acarbonetto merged 5 commits into
valkey-io:mainfrom
Bit-Quill:python/integ_acongo_xinfo_groups

Conversation

@aaron-congo

Copy link
Copy Markdown
Contributor

Issue #, if available:
N/A

Description of changes:
https://redis.io/docs/latest/commands/xinfo-groups/
https://redis.io/docs/latest/commands/xinfo-consumers/

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aaron-congo
aaron-congo requested a review from a team as a code owner July 2, 2024 00:54
@aaron-congo aaron-congo added the python 🐍 Python wrapper label Jul 2, 2024
Comment thread glide-core/src/client/value_conversion.rs
Comment thread python/python/glide/async_commands/core.py Outdated
Comment thread python/python/glide/async_commands/core.py Outdated
Comment thread python/python/tests/test_async_client.py
@aaron-congo
aaron-congo force-pushed the python/integ_acongo_xinfo_groups branch from 485c8cc to 7fcea9f Compare July 2, 2024 16:45
Comment thread glide-core/src/client/value_conversion.rs
assert consumer1_info.get(b"name") == consumer1.encode()
assert consumer1_info.get(b"pending") == 1
assert cast(int, consumer1_info.get(b"idle")) > 0
if not await check_if_server_version_lt(redis_client, "7.2.0"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we test that idle has different meanings before and after 7.2.0? From docs:

Note that before Redis 7.2.0, idle used to denote the time passed since last successful interaction. In 7.2.0, inactive was added and idle was changed to denote the time passed since last attempted interaction.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Personally I don't think its necessary, but if someone else disagrees let me know. I think we've tested the API functionality well and adding that extra test would be testing Redis functionality more than the API (although I admit the line between the two can be hazy sometimes)

@aaron-congo
aaron-congo force-pushed the python/integ_acongo_xinfo_groups branch from 5657d23 to 034aaf0 Compare July 2, 2024 18:29

@acarbonetto acarbonetto left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM - just some minor cleanup maybe

Comment thread glide-core/src/client/value_conversion.rs
Comment thread glide-core/src/protobuf/redis_request.proto Outdated
Comment thread glide-core/src/request_type.rs Outdated
Comment thread python/python/glide/async_commands/core.py Outdated
transaction.xtrim(key11, TrimByMinId(threshold="0-2", exact=True))
args.append(1)
transaction.xinfo_groups(key11)
args.append([])

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

cheater ;)

@acarbonetto
acarbonetto merged commit fe13658 into valkey-io:main Jul 2, 2024
@acarbonetto
acarbonetto deleted the python/integ_acongo_xinfo_groups branch July 2, 2024 19:24
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jul 16, 2024
* Python: add XINFO GROUPS and XINFO CONSUMERS commands

* Update CHANGELOG

* Update types to use TEncodable and bytes

* PR suggestions

* PR suggestions
Yury-Fridlyand pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 6, 2025
* Python: add XINFO GROUPS and XINFO CONSUMERS commands

* Update CHANGELOG

* Update types to use TEncodable and bytes

* PR suggestions

* PR suggestions
affonsov pushed a commit that referenced this pull request Aug 21, 2026
* Python: add XINFO GROUPS and XINFO CONSUMERS commands

* Update CHANGELOG

* Update types to use TEncodable and bytes

* PR suggestions

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

Labels

python 🐍 Python wrapper

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants