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: Adds Sort command #1439

Merged
merged 24 commits into from
Jun 5, 2024
Merged

Python: Adds Sort command #1439

merged 24 commits into from
Jun 5, 2024

Conversation

GilboaAWS
Copy link
Collaborator

We separated it into sort and sort_store.
In CME, two arguments (BY/GET) aren't supported, so we dicided to create separate APIs for CMD and CME so in CME those 2 two won't appear as optional.

@GilboaAWS GilboaAWS added the python Python wrapper label May 22, 2024
@GilboaAWS GilboaAWS requested a review from a team as a code owner May 22, 2024 13:54
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

What is CME/CMD?

Why do you split cluster and standalone implementations?

Why do you not include BY and GET pattern options for standalone?

You should also allow specifying route for cluster commands and document it.

Please, note, default routing and response handling isn't defined in redis-rs - this should be done prior to implementing a command.

Comment on lines 143 to 144
- ASC: Sort in ascending order.
- DESC: Sort in descending order.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Move this to ASC/DESC accordingly

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What is CME/CMD?

CMD: Cluster Mode Disable.
CME: Cluster Mode Enable.

As I wrote in the PR itself:

In CME, two arguments (BY/GET) aren't supported, so we dicided to create separate APIs for CMD and CME so in CME those 2 two won't appear as optional.

So for your questions:

Why do you split cluster and standalone implementations?

Because we want to limit this API call so the customer won't be able to send unsupported args to this function, so for ClusterClient we eliminated those BT\GET function's args.

Why do you not include BY and GET pattern options for standalone?

I do for standalone client, but not for ClusterClient, just for the reason I described.

You should also allow specifying route for cluster commands and document it.

This command operate on a specific key which like any other commands it doesn't need to get the route as an argument.

Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand May 27, 2024

Choose a reason for hiding this comment

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

Oh I see. The definition of CMD/CME answers to all of my questions.
Please, don't use it - it is not a Redis term. PR should be understandable for everyone.
Please, update PR description, and/or code comments. Add new function signatures to PR description for better explanation and examples.
I'll do another review round.

python/python/glide/async_commands/cluster_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/cluster_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/standalone_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/standalone_commands.py Outdated Show resolved Hide resolved
@GilboaAWS GilboaAWS force-pushed the sort_python branch 3 times, most recently from a06ee50 to 3173672 Compare May 26, 2024 08:00
@GilboaAWS GilboaAWS force-pushed the sort_python branch 5 times, most recently from 02eac42 to 75660c2 Compare May 26, 2024 09:51
@GilboaAWS GilboaAWS force-pushed the sort_python branch 2 times, most recently from 8fb41f5 to eb38f12 Compare May 27, 2024 08:41
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

Please, add a TODO comment to update implementation to comply with Redis 8 and/or create a GH issue for that.
See also my nodes in #1439 (comment)

python/python/tests/test_async_client.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/cluster_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/cluster_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/standalone_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/transaction.py Outdated Show resolved Hide resolved
python/python/tests/test_async_client.py Show resolved Hide resolved
python/python/tests/test_async_client.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/cluster_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/cluster_commands.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/command_args.py Outdated Show resolved Hide resolved
python/python/glide/async_commands/standalone_commands.py Outdated Show resolved Hide resolved
python/python/tests/test_async_client.py 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
python/python/tests/test_async_client.py Show resolved Hide resolved
Co-authored-by: Yury-Fridlyand <[email protected]>
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand left a comment

Choose a reason for hiding this comment

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

I still insist on updating PR description. Please replace CME/CMD with proper naming.

@GilboaAWS GilboaAWS merged commit ed5e482 into valkey-io:main Jun 5, 2024
46 checks passed
@GilboaAWS GilboaAWS deleted the sort_python branch June 5, 2024 09:28
yipin-chen pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 7, 2024
* Adds sort command to python

Co-authored-by: Yury-Fridlyand
Co-authored-by: Shoham Elias
Co-authored-by: Aaron 
Co-authored-by: ikolomi
cyip10 pushed a commit to Bit-Quill/valkey-glide that referenced this pull request Jun 24, 2024
* Adds sort command to python

Co-authored-by: Yury-Fridlyand
Co-authored-by: Shoham Elias
Co-authored-by: Aaron 
Co-authored-by: ikolomi
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.

6 participants