Skip to content

Commit

Permalink
Regex change 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ytkimirti committed Nov 23, 2023
1 parent 938337f commit f7096f4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
28 changes: 14 additions & 14 deletions upstash_redis/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ def georadius(
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
store: Optional[str] = None,
storedist: Optional[str] = None,
) -> ResponseT:
Expand Down Expand Up @@ -931,7 +931,7 @@ def georadius_ro(
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
) -> ResponseT:
"""
See https://redis.io/commands/georadius_ro
Expand Down Expand Up @@ -973,7 +973,7 @@ def georadiusbymember(
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
store: Optional[str] = None,
storedist: Optional[str] = None,
) -> ResponseT:
Expand Down Expand Up @@ -1024,7 +1024,7 @@ def georadiusbymember_ro(
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
) -> ResponseT:
"""
See https://redis.io/commands/georadiusbymember_ro
Expand Down Expand Up @@ -1065,7 +1065,7 @@ def geosearch(
radius: Optional[float] = None,
width: Optional[float] = None,
height: Optional[float] = None,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
count: Optional[int] = None,
any: bool = False,
withdist: bool = False,
Expand Down Expand Up @@ -1134,7 +1134,7 @@ def geosearchstore(
radius: Optional[float] = None,
width: Optional[float] = None,
height: Optional[float] = None,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
count: Optional[int] = None,
any: bool = False,
storedist: bool = False,
Expand Down Expand Up @@ -2184,7 +2184,7 @@ def dbsize(self) -> ResponseT:
return self.execute(command)

def flushall(
self, flush_type: Union[Literal["ASYNC", "SYNC"], None] = None
self, flush_type: Optional[Literal["ASYNC", "SYNC"]] = None
) -> ResponseT:
"""
See https://redis.io/commands/flushall
Expand All @@ -2198,7 +2198,7 @@ def flushall(
return self.execute(command)

def flushdb(
self, flush_type: Union[Literal["ASYNC", "SYNC"], None] = None
self, flush_type: Optional[Literal["ASYNC", "SYNC"]] = None
) -> ResponseT:
"""
See https://redis.io/commands/flushdb
Expand Down Expand Up @@ -2837,7 +2837,7 @@ def zinter(
self,
keys: List[str],
weights: Union[List[float], List[int], None] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
withscores: bool = False,
) -> ResponseT:
"""
Expand Down Expand Up @@ -2889,7 +2889,7 @@ def zinterstore(
destination: str,
keys: List[str],
weights: Union[List[float], List[int], None] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
) -> ResponseT:
"""
Calculates the intersection between multiple sorted sets and stores it in a key.
Expand Down Expand Up @@ -3072,7 +3072,7 @@ def zrange(
key: str,
start: FloatMinMaxT,
stop: FloatMinMaxT,
sortby: Union[Literal["BYSCORE", "BYLEX"], None] = None,
sortby: Optional[Literal["BYSCORE", "BYLEX"]] = None,
rev: bool = False,
offset: Optional[int] = None,
count: Optional[int] = None,
Expand Down Expand Up @@ -3208,7 +3208,7 @@ def zrangestore(
src: str,
min: FloatMinMaxT,
max: FloatMinMaxT,
sortby: Union[Literal["BYSCORE", "BYLEX"], None] = None,
sortby: Optional[Literal["BYSCORE", "BYLEX"]] = None,
rev: bool = False,
offset: Optional[int] = None,
count: Optional[int] = None,
Expand Down Expand Up @@ -3510,7 +3510,7 @@ def zunion(
self,
keys: List[str],
weights: Optional[List[float]] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
withscores: bool = False,
) -> ResponseT:
"""
Expand Down Expand Up @@ -3560,7 +3560,7 @@ def zunionstore(
destination: str,
keys: List[str],
weights: Union[List[float], List[int], None] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
) -> ResponseT:
"""
Returns the union between multiple sorted sets.
Expand Down
56 changes: 28 additions & 28 deletions upstash_redis/commands.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class Commands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
store: Optional[str] = None,
storedist: Optional[str] = None,
) -> Union[List[Union[str, GeoSearchResult]], int]: ...
Expand All @@ -126,7 +126,7 @@ class Commands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
) -> List[Union[str, GeoSearchResult]]: ...
def georadiusbymember(
self,
Expand All @@ -139,7 +139,7 @@ class Commands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
store: Optional[str] = None,
storedist: Optional[str] = None,
) -> Union[List[Union[str, GeoSearchResult]], int]: ...
Expand All @@ -154,7 +154,7 @@ class Commands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
) -> List[Union[str, GeoSearchResult]]: ...
def geosearch(
self,
Expand All @@ -166,7 +166,7 @@ class Commands:
radius: Optional[float] = None,
width: Optional[float] = None,
height: Optional[float] = None,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
count: Optional[int] = None,
any: bool = False,
withdist: bool = False,
Expand All @@ -184,7 +184,7 @@ class Commands:
radius: Optional[float] = None,
width: Optional[float] = None,
height: Optional[float] = None,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
count: Optional[int] = None,
any: bool = False,
storedist: bool = False,
Expand Down Expand Up @@ -276,10 +276,10 @@ class Commands:
) -> Any: ...
def dbsize(self) -> int: ...
def flushall(
self, flush_type: Union[Literal["ASYNC", "SYNC"], None] = None
self, flush_type: Optional[Literal["ASYNC", "SYNC"]] = None
) -> bool: ...
def flushdb(
self, flush_type: Union[Literal["ASYNC", "SYNC"], None] = None
self, flush_type: Optional[Literal["ASYNC", "SYNC"]] = None
) -> bool: ...
def time(self) -> Tuple[int, int]: ...
def sadd(self, key: str, *members: Value) -> int: ...
Expand Down Expand Up @@ -330,15 +330,15 @@ class Commands:
self,
keys: List[str],
weights: Union[List[float], List[int], None] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
withscores: bool = False,
) -> Union[List[str], List[Tuple[str, float]]]: ...
def zinterstore(
self,
destination: str,
keys: List[str],
weights: Union[List[float], List[int], None] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
) -> int: ...
def zlexcount(self, key: str, min: str, max: str) -> int: ...
def zmscore(self, key: str, members: List[str]) -> List[Optional[float]]: ...
Expand All @@ -356,7 +356,7 @@ class Commands:
key: str,
start: FloatMinMaxT,
stop: FloatMinMaxT,
sortby: Union[Literal["BYSCORE", "BYLEX"], None] = None,
sortby: Optional[Literal["BYSCORE", "BYLEX"]] = None,
rev: bool = False,
offset: Optional[int] = None,
count: Optional[int] = None,
Expand Down Expand Up @@ -385,7 +385,7 @@ class Commands:
src: str,
min: FloatMinMaxT,
max: FloatMinMaxT,
sortby: Union[Literal["BYSCORE", "BYLEX"], None] = None,
sortby: Optional[Literal["BYSCORE", "BYLEX"]] = None,
rev: bool = False,
offset: Optional[int] = None,
count: Optional[int] = None,
Expand Down Expand Up @@ -430,15 +430,15 @@ class Commands:
self,
keys: List[str],
weights: Optional[List[float]] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
withscores: bool = False,
) -> Union[List[str], List[Tuple[str, float]]]: ...
def zunionstore(
self,
destination: str,
keys: List[str],
weights: Optional[List[float]] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
) -> int: ...
def append(self, key: str, value: str) -> int: ...
def decr(self, key: str) -> int: ...
Expand Down Expand Up @@ -597,7 +597,7 @@ class AsyncCommands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
store: Optional[str] = None,
storedist: Optional[str] = None,
) -> Union[List[Union[str, GeoSearchResult]], int]: ...
Expand All @@ -613,7 +613,7 @@ class AsyncCommands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
) -> List[Union[str, GeoSearchResult]]: ...
async def georadiusbymember(
self,
Expand All @@ -626,7 +626,7 @@ class AsyncCommands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
store: Optional[str] = None,
storedist: Optional[str] = None,
) -> Union[List[Union[str, GeoSearchResult]], int]: ...
Expand All @@ -641,7 +641,7 @@ class AsyncCommands:
withcoord: bool = False,
count: Optional[int] = None,
any: bool = False,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
) -> List[Union[str, GeoSearchResult]]: ...
async def geosearch(
self,
Expand All @@ -653,7 +653,7 @@ class AsyncCommands:
radius: Optional[float] = None,
width: Optional[float] = None,
height: Optional[float] = None,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
count: Optional[int] = None,
any: bool = False,
withdist: bool = False,
Expand All @@ -671,7 +671,7 @@ class AsyncCommands:
radius: Optional[float] = None,
width: Optional[float] = None,
height: Optional[float] = None,
order: Union[Literal["ASC", "DESC"], None] = None,
order: Optional[Literal["ASC", "DESC"]] = None,
count: Optional[int] = None,
any: bool = False,
storedist: bool = False,
Expand Down Expand Up @@ -763,10 +763,10 @@ class AsyncCommands:
) -> Any: ...
async def dbsize(self) -> int: ...
async def flushall(
self, flush_type: Union[Literal["ASYNC", "SYNC"], None] = None
self, flush_type: Optional[Literal["ASYNC", "SYNC"]] = None
) -> bool: ...
async def flushdb(
self, flush_type: Union[Literal["ASYNC", "SYNC"], None] = None
self, flush_type: Optional[Literal["ASYNC", "SYNC"]] = None
) -> bool: ...
async def time(self) -> Tuple[int, int]: ...
async def sadd(self, key: str, *members: Value) -> int: ...
Expand Down Expand Up @@ -817,15 +817,15 @@ class AsyncCommands:
self,
keys: List[str],
weights: Union[List[float], List[int], None] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
withscores: bool = False,
) -> Union[List[str], List[Tuple[str, float]]]: ...
async def zinterstore(
self,
destination: str,
keys: List[str],
weights: Union[List[float], List[int], None] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
) -> int: ...
async def zlexcount(self, key: str, min: str, max: str) -> int: ...
async def zmscore(
Expand All @@ -845,7 +845,7 @@ class AsyncCommands:
key: str,
start: FloatMinMaxT,
stop: FloatMinMaxT,
sortby: Union[Literal["BYSCORE", "BYLEX"], None] = None,
sortby: Optional[Literal["BYSCORE", "BYLEX"]] = None,
rev: bool = False,
offset: Optional[int] = None,
count: Optional[int] = None,
Expand Down Expand Up @@ -874,7 +874,7 @@ class AsyncCommands:
src: str,
min: FloatMinMaxT,
max: FloatMinMaxT,
sortby: Union[Literal["BYSCORE", "BYLEX"], None] = None,
sortby: Optional[Literal["BYSCORE", "BYLEX"]] = None,
rev: bool = False,
offset: Optional[int] = None,
count: Optional[int] = None,
Expand Down Expand Up @@ -919,15 +919,15 @@ class AsyncCommands:
self,
keys: List[str],
weights: Optional[List[float]] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
withscores: bool = False,
) -> Union[List[str], List[Tuple[str, float]]]: ...
async def zunionstore(
self,
destination: str,
keys: List[str],
weights: Optional[List[float]] = None,
aggregate: Union[Literal["SUM", "MIN", "MAX"], None] = None,
aggregate: Optional[Literal["SUM", "MIN", "MAX"]] = None,
) -> int: ...
async def append(self, key: str, value: str) -> int: ...
async def decr(self, key: str) -> int: ...
Expand Down
2 changes: 1 addition & 1 deletion upstash_redis/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def handle_geosearch_exceptions(


def handle_non_deprecated_zrange_exceptions(
sortby: Union[Literal["BYLEX", "BYSCORE"], None],
sortby: Optional[Literal["BYLEX", "BYSCORE"]],
start: FloatMinMaxT,
stop: FloatMinMaxT,
offset: Optional[int],
Expand Down

0 comments on commit f7096f4

Please sign in to comment.