Skip to content

Commit

Permalink
Fix Limit doc
Browse files Browse the repository at this point in the history
  • Loading branch information
GilboaAWS committed May 27, 2024
1 parent 8e3d323 commit 970288b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
9 changes: 3 additions & 6 deletions python/python/glide/async_commands/cluster_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,7 @@ async def sort(
Args:
key (str): The key of the list, set, or sorted set to be sorted.
limit (Optional[Limit]): The limit argument for a range query. Defaults to None. See `Limit` class for more information.
A tuple specifying the offset and count for limiting the number of results returned.
The `limit` parameter takes a tuple `(offset, count)` where `offset` specifies the starting position and `count` specifies the maximum number of elements to return.
If `offset` exceeds the length of the returned result, an empty list is returned.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
order (Optional[OrderBy]): Specifies the order to sort the elements.
Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): When `True`, sorts elements lexicographically. When `False` (default), sorts elements numerically.
Expand Down Expand Up @@ -395,7 +392,7 @@ async def sort_store(
self,
key: str,
store: str,
limit: Optional[Tuple[int, int]] = None,
limit: Optional[Limit] = None,
order: Optional[OrderBy] = None,
alpha: Optional[bool] = None,
) -> int:
Expand All @@ -409,7 +406,7 @@ async def sort_store(
Args:
key (str): The key of the list, set, or sorted set to be sorted.
store (str): The key where the sorted result will be stored.
limit (Optional[Tuple[int, int]]): A tuple specifying the offset and count for limiting the number of results.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
order (Optional[OrderBy]): Specifies the order to sort the elements. Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): Whether to sort elements lexicographically. If `False`, elements are sorted numerically.
Expand Down
4 changes: 2 additions & 2 deletions python/python/glide/async_commands/standalone_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async def sort(
Args:
key (str): The key of the list, set, or sorted set to be sorted.
by_pattern (Optional[str]): A pattern to sort by. If not provided, elements are sorted by their value.
limit (Optional[Limit]): A tuple specifying the offset and count for limiting the number of results.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
get_patterns (Optional[List[str]]): One or more patterns to extract values to return.
order (Optional[OrderBy]): Specifies the order to sort the elements. Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): Whether to sort elements lexicographically. If `False`, elements are sorted numerically.
Expand Down Expand Up @@ -315,7 +315,7 @@ async def sort_store(
key (str): The key of the list, set, or sorted set to be sorted.
store (str): The key where the sorted result will be stored.
by_pattern (Optional[str]): A pattern to sort by. If not provided, elements are sorted by their value.
limit (Optional[Limit]): A tuple specifying the offset and count for limiting the number of results.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
get_patterns (Optional[List[str]]): One or more patterns to extract values to return.
order (Optional[OrderBy]): Specifies the order to sort the elements. Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): Whether to sort elements lexicographically. If `False`, elements are sorted numerically.
Expand Down
8 changes: 4 additions & 4 deletions python/python/glide/async_commands/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2515,7 +2515,7 @@ def sort(
Args:
key (str): The key of the list, set, or sorted set to be sorted.
by_pattern (Optional[str]): A pattern to sort by. If not provided, elements are sorted by their value.
limit (Optional[Limit]): A tuple specifying the offset and count for limiting the number of results.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
get_patterns (Optional[List[str]]): One or more patterns to extract values to return.
order (Optional[OrderBy]): Specifies the order to sort the elements. Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): Whether to sort elements lexicographically. If `False`, elements are sorted numerically.
Expand Down Expand Up @@ -2547,7 +2547,7 @@ def sort_store(
key (str): The key of the list, set, or sorted set to be sorted.
store (str): The key where the sorted result will be stored.
by_pattern (Optional[str]): A pattern to sort by. If not provided, elements are sorted by their value.
limit (Optional[Limit]): A tuple specifying the offset and count for limiting the number of results.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
get_patterns (Optional[List[str]]): One or more patterns to extract values to return.
order (Optional[OrderBy]): Specifies the order to sort the elements. Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): Whether to sort elements lexicographically. If `False`, elements are sorted numerically.
Expand Down Expand Up @@ -2585,7 +2585,7 @@ def sort(
Args:
key (str): The key of the list, set, or sorted set to be sorted.
limit (Optional[Limit]): A tuple specifying the offset and count for limiting the number of results.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
order (Optional[OrderBy]): Specifies the order to sort the elements. Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): Whether to sort elements lexicographically. If `False`, elements are sorted numerically.
Expand Down Expand Up @@ -2613,7 +2613,7 @@ def sort_store(
Args:
key (str): The key of the list, set, or sorted set to be sorted.
store (str): The key where the sorted result will be stored.
limit (Optional[Limit]): A tuple specifying the offset and count for limiting the number of results.
limit (Optional[Limit]): Limiting the range of the query by setting offset and result count. See `Limit` class for more information.
order (Optional[OrderBy]): Specifies the order to sort the elements. Can be `OrderBy.ASC` (ascending) or `OrderBy.DESC` (descending).
alpha (Optional[bool]): Whether to sort elements lexicographically. If `False`, elements are sorted numerically.
Expand Down

0 comments on commit 970288b

Please sign in to comment.