-
Notifications
You must be signed in to change notification settings - Fork 68
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 SORT_RO command. #1528
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add changelog entry
Please add changelog entry |
5496fce
to
51b58ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check that docs are aligned
alpha: Optional[bool] = None, | ||
) -> TTransaction: | ||
""" | ||
Sorts the elements in the list, set, or sorted set at `key` and returns the result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorts the elements in the list, set, or sorted set at `key` and returns the result. | |
Sorts the elements in the list, set, or sorted set at `key` and returns the result. | |
The `sort_ro` command can be used to sort elements based on different criteria and apply transformations on sorted elements. |
|
||
By default, sorting is numeric, and elements are compared by their value interpreted as double precision floating point numbers. | ||
|
||
See https://valkey.io/commands/sort_ro for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this link is not exits. there is a mention about this command in - https://valkey.io/commands/sort/ . but not describe how to use in sort_ro.
I asked Medy if is going to be added or to refer to sort command
""" | ||
args = _build_sort_args(key, None, limit, None, order, alpha) | ||
result = await self._execute_command(RequestType.SortReadOnly, args) | ||
return cast(List[str], result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the str
""" | ||
Sorts the elements in the list, set, or sorted set at `key` and returns the result. | ||
|
||
See https://valkey.io/commands/sort_ro for more details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -4749,6 +4765,15 @@ async def test_sort_and_sort_store_with_get_or_by_args( | |||
["Dave", "Bob", "Alice", "Charlie", "Eve"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a test which check list of bytes and mixed list of bytes and strings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please double check that doc is aligned with java client - we had there few rounds of reviews and already merged it.
You can update docs on both clients if you find it is neccesary.
@@ -4611,6 +4611,7 @@ def sort( | |||
""" | |||
Sorts the elements in the list, set, or sorted set at `key` and returns the result. | |||
The `sort` command can be used to sort elements based on different criteria and apply transformations on sorted elements. | |||
This command is routed to primary nodes only. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you don't need to add it here - the command isn't routed there, an entire transaction is routed ... according to the first command it has.
If you want to have such notice in transaction implementation, please reword it to reflect the actual behavior.
Co-authored-by: Yury-Fridlyand <[email protected]>
* Python: add SORT_RO command.
* Python: add SORT_RO command.
No description provided.