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 HRANDFIELD command #1334

Merged

Conversation

aaron-congo
Copy link
Collaborator

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

Issue #, if available:
N/A

Description of changes:

  • https://redis.io/docs/latest/commands/hrandfield/
  • Includes value conversion:
    • RESP2 returns a flat array of BulkString values, where even-positioned elements are keys and odd-positioned elements are values. RESP3 returns an array of array of BulkString values (in other words, a 2D-array where the inner arrays are key-value pairs). The value conversion converts the RESP2 responses to the RESP3 format.
    • Note that the returned type is a List instead of a Dict because the response may contain duplicates if the user passes in a negative count argument

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

python/python/tests/test_transaction.py Outdated Show resolved Hide resolved
@aaron-congo aaron-congo force-pushed the python/integ_acongo_hrandfield branch from e5634dc to e6e028c Compare April 26, 2024 21:34
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/transaction.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/transaction.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/transaction.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/transaction.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/transaction.py Outdated Show resolved Hide resolved
python/python/tests/test_transaction.py Outdated Show resolved Hide resolved
@aaron-congo aaron-congo force-pushed the python/integ_acongo_hrandfield branch from b83e734 to 6dabc76 Compare April 30, 2024 20:47
glide-core/src/client/value_conversion.rs Outdated Show resolved Hide resolved
@acarbonetto acarbonetto merged commit d8bdfa7 into valkey-io:main May 1, 2024
45 checks passed
@acarbonetto acarbonetto deleted the python/integ_acongo_hrandfield branch May 1, 2024 15:58
tjzhang-BQ pushed a commit to Bit-Quill/valkey-glide that referenced this pull request May 8, 2024
* Python: add HRANDFIELD command

* Use variable for 'WITHVALUES' arg

* PR suggestions

* Remove WITH_VALUES constant

* PR suggestions
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Python: add HRANDFIELD command

* Use variable for 'WITHVALUES' arg

* PR suggestions

* Remove WITH_VALUES constant

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

Successfully merging this pull request may close these issues.

6 participants