Skip to content

Commit a694dfb

Browse files
committed
delete sort_ro
1 parent 8724607 commit a694dfb

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

redis/commands/core.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import hashlib
33
import time
44
import warnings
5-
from typing import List, Optional
65

76
from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
87

@@ -2185,39 +2184,6 @@ def sort(
21852184
options = {"groups": len(get) if groups else None}
21862185
return self.execute_command("SORT", *pieces, **options)
21872186

2188-
def sort_ro(
2189-
self,
2190-
key: str,
2191-
start: Optional[int] = None,
2192-
num: Optional[int] = None,
2193-
by: Optional[str] = None,
2194-
get: Optional[List[str]] = None,
2195-
desc: bool = False,
2196-
alpha: bool = False,
2197-
) -> list:
2198-
"""
2199-
Returns the elements contained in the list, set or sorted set at key.
2200-
(read-only variant of the SORT command)
2201-
2202-
``start`` and ``num`` allow for paging through the sorted data
2203-
2204-
``by`` allows using an external key to weight and sort the items.
2205-
Use an "*" to indicate where in the key the item value is located
2206-
2207-
``get`` allows for returning items from external keys rather than the
2208-
sorted data itself. Use an "*" to indicate where in the key
2209-
the item value is located
2210-
2211-
``desc`` allows for reversing the sort
2212-
2213-
``alpha`` allows for sorting lexicographically rather than numerically
2214-
2215-
For more information check https://redis.io/commands/sort_ro
2216-
"""
2217-
return self.sort(
2218-
key, start=start, num=num, by=by, get=get, desc=desc, alpha=alpha
2219-
)
2220-
22212187

22222188
class ScanCommands:
22232189
"""

tests/test_commands.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,16 +2639,6 @@ def test_sort_all_options(self, r):
26392639
assert num == 4
26402640
assert r.lrange("sorted", 0, 10) == [b"vodka", b"milk", b"gin", b"apple juice"]
26412641

2642-
# @skip_if_server_version_lt("7.0.0") turn on after redis 7 release
2643-
def test_sort_ro(self, unstable_r):
2644-
unstable_r["score:1"] = 8
2645-
unstable_r["score:2"] = 3
2646-
unstable_r["score:3"] = 5
2647-
unstable_r.rpush("a", "3", "2", "1")
2648-
assert unstable_r.sort_ro("a", by="score:*") == [b"2", b"3", b"1"]
2649-
unstable_r.rpush("b", "2", "3", "1")
2650-
assert unstable_r.sort_ro("b", desc=True) == [b"3", b"2", b"1"]
2651-
26522642
def test_sort_issue_924(self, r):
26532643
# Tests for issue https://github.com/andymccurdy/redis-py/issues/924
26542644
r.execute_command("SADD", "issue#924", 1)

0 commit comments

Comments
 (0)