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

Python: add XGROUP CREATE and XGROUP DESTROY commands #1646

Conversation

aaron-congo
Copy link
Collaborator

@aaron-congo aaron-congo commented Jun 24, 2024

Issue #, if available:
N/A

Description of changes:
https://redis.io/docs/latest/commands/xgroup-create/
https://redis.io/docs/latest/commands/xgroup-destroy/

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 June 24, 2024 23:58
async def test_xgroup_create_xgroup_destroy(
self, redis_client: TRedisClient, cluster_mode, protocol, request
):
key = get_random_string(10)
Copy link
Collaborator

Choose a reason for hiding this comment

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

In XREAD, you use key1 = f"{{testKey}}:1-{get_random_string(10)}".

Copy link
Collaborator

Choose a reason for hiding this comment

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

I do find prefixing the keys with something unique to the test is helpful for debugging.
Same for group_name, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, that's because XREAD is a multi-key command, so the keys need to have the same hash tag in order to be mapped to the same hash slot. XGROUP CREATE/DESTROY are single-key commands so they do not have this requirement.

@acarbonetto acarbonetto merged commit 51ffa3b into valkey-io:main Jun 25, 2024
6 checks passed
@acarbonetto acarbonetto deleted the python/integ_acongo_xgroup_create_destroy branch June 25, 2024 17:01
jduo pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

4 participants