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 ZRANDMEMBER command #1413

Merged

Conversation

aaron-congo
Copy link
Collaborator

@aaron-congo aaron-congo commented May 14, 2024

Issue #, if available:
https://redis.io/docs/latest/commands/zrandmember/

Description of changes:

  • adds ZRANDMEMBER command to the Python client
  • adds value conversion to convert RESP2 responses (flat arrays with scores as strings) to RESP2 responses (array of pairs with scores as doubles)
    • refactors some logic that was previously used to convert to ArrayOfKeyValuePairs, since the logic to convert to ArrayOfMemberScorePairs is the same but has an added step of converting scores to type double

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 May 14, 2024 22:02
@aaron-congo aaron-congo added the python Python wrapper label May 14, 2024
@aaron-congo aaron-congo requested review from Yury-Fridlyand, acarbonetto, jonathanl-bq and shohamazon and removed request for Yury-Fridlyand May 14, 2024 22:06
Copy link
Collaborator

@shohamazon shohamazon left a comment

Choose a reason for hiding this comment

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

so many sorted set commands

python/python/glide/async_commands/core.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/core.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/core.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/core.py Outdated Show resolved Hide resolved
python/python/tests/test_async_client.py Outdated Show resolved Hide resolved
python/python/tests/test_async_client.py Outdated Show resolved Hide resolved
@aaron-congo aaron-congo force-pushed the python/integ_acongo_zrandmember branch from c6ac0d2 to 74f12ce Compare May 16, 2024 18:30
@Yury-Fridlyand Yury-Fridlyand merged commit 5b2e925 into valkey-io:main May 16, 2024
45 checks passed
@Yury-Fridlyand Yury-Fridlyand deleted the python/integ_acongo_zrandmember branch May 16, 2024 23:32
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Python: add ZRANDMEMBER command (#276)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python Python wrapper
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants