Skip to content

Commit 8df197c

Browse files
committed
fix(redis-client): replace Optional[None] with Optional[int] for numeric parameters
1 parent 339d180 commit 8df197c

File tree

1 file changed

+53
-53
lines changed

1 file changed

+53
-53
lines changed

redis/commands/core.py

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def acl_deluser(self, *username: str, **kwargs) -> ResponseT:
9292
"""
9393
return self.execute_command("ACL DELUSER", *username, **kwargs)
9494

95-
def acl_genpass(self, bits: Optional[None] = None, **kwargs) -> ResponseT:
95+
def acl_genpass(self, bits: Optional[int] = None, **kwargs) -> ResponseT:
9696
"""Generate a random password value.
9797
If ``bits`` is supplied then use this number of bits, rounded to
9898
the next multiple of 4.
@@ -1304,7 +1304,7 @@ def slaveof(
13041304
return self.execute_command("SLAVEOF", b"NO", b"ONE", **kwargs)
13051305
return self.execute_command("SLAVEOF", host, port, **kwargs)
13061306

1307-
def slowlog_get(self, num: Optional[None] = None, **kwargs) -> ResponseT:
1307+
def slowlog_get(self, num: Optional[int] = None, **kwargs) -> ResponseT:
13081308
"""
13091309
Get the entries from the slowlog. If ``num`` is specified, get the
13101310
most recent ``num`` items.
@@ -1572,8 +1572,8 @@ def append(self, key: KeyT, value: EncodableT) -> ResponseT:
15721572
def bitcount(
15731573
self,
15741574
key: KeyT,
1575-
start: Optional[None] = None,
1576-
end: Optional[None] = None,
1575+
start: Optional[int] = None,
1576+
end: Optional[int] = None,
15771577
mode: Optional[str] = None,
15781578
) -> ResponseT:
15791579
"""
@@ -1641,8 +1641,8 @@ def bitpos(
16411641
self,
16421642
key: KeyT,
16431643
bit: int,
1644-
start: Optional[None] = None,
1645-
end: Optional[None] = None,
1644+
start: Optional[int] = None,
1645+
end: Optional[int] = None,
16461646
mode: Optional[str] = None,
16471647
) -> ResponseT:
16481648
"""
@@ -2191,8 +2191,8 @@ def restore(
21912191
value: EncodableT,
21922192
replace: bool = False,
21932193
absttl: bool = False,
2194-
idletime: Optional[None] = None,
2195-
frequency: Optional[None] = None,
2194+
idletime: Optional[int] = None,
2195+
frequency: Optional[int] = None,
21962196
) -> ResponseT:
21972197
"""
21982198
Create a key using the provided serialized value, previously obtained
@@ -2360,7 +2360,7 @@ def stralgo(
23602360
specific_argument: Union[Literal["strings"], Literal["keys"]] = "strings",
23612361
len: bool = False,
23622362
idx: bool = False,
2363-
minmatchlen: Optional[None] = None,
2363+
minmatchlen: Optional[int] = None,
23642364
withmatchlen: bool = False,
23652365
**kwargs,
23662366
) -> ResponseT:
@@ -2960,7 +2960,7 @@ def scan(
29602960
self,
29612961
cursor: int = 0,
29622962
match: Union[PatternT, None] = None,
2963-
count: Optional[None] = None,
2963+
count: Optional[int] = None,
29642964
_type: Optional[str] = None,
29652965
**kwargs,
29662966
) -> ResponseT:
@@ -2992,7 +2992,7 @@ def scan(
29922992
def scan_iter(
29932993
self,
29942994
match: Union[PatternT, None] = None,
2995-
count: Optional[None] = None,
2995+
count: Optional[int] = None,
29962996
_type: Optional[str] = None,
29972997
**kwargs,
29982998
) -> Iterator:
@@ -3022,7 +3022,7 @@ def sscan(
30223022
name: KeyT,
30233023
cursor: int = 0,
30243024
match: Union[PatternT, None] = None,
3025-
count: Optional[None] = None,
3025+
count: Optional[int] = None,
30263026
) -> ResponseT:
30273027
"""
30283028
Incrementally return lists of elements in a set. Also return a cursor
@@ -3045,7 +3045,7 @@ def sscan_iter(
30453045
self,
30463046
name: KeyT,
30473047
match: Union[PatternT, None] = None,
3048-
count: Optional[None] = None,
3048+
count: Optional[int] = None,
30493049
) -> Iterator:
30503050
"""
30513051
Make an iterator using the SSCAN command so that the client doesn't
@@ -3065,7 +3065,7 @@ def hscan(
30653065
name: KeyT,
30663066
cursor: int = 0,
30673067
match: Union[PatternT, None] = None,
3068-
count: Optional[None] = None,
3068+
count: Optional[int] = None,
30693069
no_values: Union[bool, None] = None,
30703070
) -> ResponseT:
30713071
"""
@@ -3093,7 +3093,7 @@ def hscan_iter(
30933093
self,
30943094
name: str,
30953095
match: Union[PatternT, None] = None,
3096-
count: Optional[None] = None,
3096+
count: Optional[int] = None,
30973097
no_values: Union[bool, None] = None,
30983098
) -> Iterator:
30993099
"""
@@ -3121,7 +3121,7 @@ def zscan(
31213121
name: KeyT,
31223122
cursor: int = 0,
31233123
match: Union[PatternT, None] = None,
3124-
count: Optional[None] = None,
3124+
count: Optional[int] = None,
31253125
score_cast_func: Union[type, Callable] = float,
31263126
) -> ResponseT:
31273127
"""
@@ -3148,7 +3148,7 @@ def zscan_iter(
31483148
self,
31493149
name: KeyT,
31503150
match: Union[PatternT, None] = None,
3151-
count: Optional[None] = None,
3151+
count: Optional[int] = None,
31523152
score_cast_func: Union[type, Callable] = float,
31533153
) -> Iterator:
31543154
"""
@@ -3177,7 +3177,7 @@ class AsyncScanCommands(ScanCommands):
31773177
async def scan_iter(
31783178
self,
31793179
match: Union[PatternT, None] = None,
3180-
count: Optional[None] = None,
3180+
count: Optional[int] = None,
31813181
_type: Optional[str] = None,
31823182
**kwargs,
31833183
) -> AsyncIterator:
@@ -3207,7 +3207,7 @@ async def sscan_iter(
32073207
self,
32083208
name: KeyT,
32093209
match: Union[PatternT, None] = None,
3210-
count: Optional[None] = None,
3210+
count: Optional[int] = None,
32113211
) -> AsyncIterator:
32123212
"""
32133213
Make an iterator using the SSCAN command so that the client doesn't
@@ -3229,7 +3229,7 @@ async def hscan_iter(
32293229
self,
32303230
name: str,
32313231
match: Union[PatternT, None] = None,
3232-
count: Optional[None] = None,
3232+
count: Optional[int] = None,
32333233
no_values: Union[bool, None] = None,
32343234
) -> AsyncIterator:
32353235
"""
@@ -3258,7 +3258,7 @@ async def zscan_iter(
32583258
self,
32593259
name: KeyT,
32603260
match: Union[PatternT, None] = None,
3261-
count: Optional[None] = None,
3261+
count: Optional[int] = None,
32623262
score_cast_func: Union[type, Callable] = float,
32633263
) -> AsyncIterator:
32643264
"""
@@ -3489,11 +3489,11 @@ def xadd(
34893489
name: KeyT,
34903490
fields: Dict[FieldT, EncodableT],
34913491
id: StreamIdT = "*",
3492-
maxlen: Optional[None] = None,
3492+
maxlen: Optional[int] = None,
34933493
approximate: bool = True,
34943494
nomkstream: bool = False,
34953495
minid: Union[StreamIdT, None] = None,
3496-
limit: Optional[None] = None,
3496+
limit: Optional[int] = None,
34973497
) -> ResponseT:
34983498
"""
34993499
Add to a stream.
@@ -3544,7 +3544,7 @@ def xautoclaim(
35443544
consumername: ConsumerT,
35453545
min_idle_time: int,
35463546
start_id: StreamIdT = "0-0",
3547-
count: Optional[None] = None,
3547+
count: Optional[int] = None,
35483548
justid: bool = False,
35493549
) -> ResponseT:
35503550
"""
@@ -3595,9 +3595,9 @@ def xclaim(
35953595
consumername: ConsumerT,
35963596
min_idle_time: int,
35973597
message_ids: Union[List[StreamIdT], Tuple[StreamIdT]],
3598-
idle: Optional[None] = None,
3599-
time: Optional[None] = None,
3600-
retrycount: Optional[None] = None,
3598+
idle: Optional[int] = None,
3599+
time: Optional[int] = None,
3600+
retrycount: Optional[int] = None,
36013601
force: bool = False,
36023602
justid: bool = False,
36033603
) -> ResponseT:
@@ -3829,7 +3829,7 @@ def xpending_range(
38293829
max: StreamIdT,
38303830
count: int,
38313831
consumername: Union[ConsumerT, None] = None,
3832-
idle: Optional[None] = None,
3832+
idle: Optional[int] = None,
38333833
) -> ResponseT:
38343834
"""
38353835
Returns information about pending messages, in a range.
@@ -3883,7 +3883,7 @@ def xrange(
38833883
name: KeyT,
38843884
min: StreamIdT = "-",
38853885
max: StreamIdT = "+",
3886-
count: Optional[None] = None,
3886+
count: Optional[int] = None,
38873887
) -> ResponseT:
38883888
"""
38893889
Read stream values within an interval.
@@ -3913,8 +3913,8 @@ def xrange(
39133913
def xread(
39143914
self,
39153915
streams: Dict[KeyT, StreamIdT],
3916-
count: Optional[None] = None,
3917-
block: Optional[None] = None,
3916+
count: Optional[int] = None,
3917+
block: Optional[int] = None,
39183918
) -> ResponseT:
39193919
"""
39203920
Block and monitor multiple streams for new data.
@@ -3953,8 +3953,8 @@ def xreadgroup(
39533953
groupname: str,
39543954
consumername: str,
39553955
streams: Dict[KeyT, StreamIdT],
3956-
count: Optional[None] = None,
3957-
block: Optional[None] = None,
3956+
count: Optional[int] = None,
3957+
block: Optional[int] = None,
39583958
noack: bool = False,
39593959
) -> ResponseT:
39603960
"""
@@ -4000,7 +4000,7 @@ def xrevrange(
40004000
name: KeyT,
40014001
max: StreamIdT = "+",
40024002
min: StreamIdT = "-",
4003-
count: Optional[None] = None,
4003+
count: Optional[int] = None,
40044004
) -> ResponseT:
40054005
"""
40064006
Read stream values within an interval, in reverse order.
@@ -4030,10 +4030,10 @@ def xrevrange(
40304030
def xtrim(
40314031
self,
40324032
name: KeyT,
4033-
maxlen: Optional[None] = None,
4033+
maxlen: Optional[int] = None,
40344034
approximate: bool = True,
40354035
minid: Union[StreamIdT, None] = None,
4036-
limit: Optional[None] = None,
4036+
limit: Optional[int] = None,
40374037
) -> ResponseT:
40384038
"""
40394039
Trims old messages from a stream.
@@ -4263,7 +4263,7 @@ def zlexcount(self, name, min, max):
42634263
"""
42644264
return self.execute_command("ZLEXCOUNT", name, min, max, keys=[name])
42654265

4266-
def zpopmax(self, name: KeyT, count: Optional[None] = None) -> ResponseT:
4266+
def zpopmax(self, name: KeyT, count: Optional[int] = None) -> ResponseT:
42674267
"""
42684268
Remove and return up to ``count`` members with the highest scores
42694269
from the sorted set ``name``.
@@ -4274,7 +4274,7 @@ def zpopmax(self, name: KeyT, count: Optional[None] = None) -> ResponseT:
42744274
options = {"withscores": True}
42754275
return self.execute_command("ZPOPMAX", name, *args, **options)
42764276

4277-
def zpopmin(self, name: KeyT, count: Optional[None] = None) -> ResponseT:
4277+
def zpopmin(self, name: KeyT, count: Optional[int] = None) -> ResponseT:
42784278
"""
42794279
Remove and return up to ``count`` members with the lowest scores
42804280
from the sorted set ``name``.
@@ -4418,8 +4418,8 @@ def _zrange(
44184418
bylex: bool = False,
44194419
withscores: bool = False,
44204420
score_cast_func: Union[type, Callable, None] = float,
4421-
offset: Optional[None] = None,
4422-
num: Optional[None] = None,
4421+
offset: Optional[int] = None,
4422+
num: Optional[int] = None,
44234423
) -> ResponseT:
44244424
if byscore and bylex:
44254425
raise DataError("``byscore`` and ``bylex`` can not be specified together.")
@@ -4545,8 +4545,8 @@ def zrangestore(
45454545
byscore: bool = False,
45464546
bylex: bool = False,
45474547
desc: bool = False,
4548-
offset: Optional[None] = None,
4549-
num: Optional[None] = None,
4548+
offset: Optional[int] = None,
4549+
num: Optional[int] = None,
45504550
) -> ResponseT:
45514551
"""
45524552
Stores in ``dest`` the result of a range of values from sorted set
@@ -4591,8 +4591,8 @@ def zrangebylex(
45914591
name: KeyT,
45924592
min: EncodableT,
45934593
max: EncodableT,
4594-
start: Optional[None] = None,
4595-
num: Optional[None] = None,
4594+
start: Optional[int] = None,
4595+
num: Optional[int] = None,
45964596
) -> ResponseT:
45974597
"""
45984598
Return the lexicographical range of values from sorted set ``name``
@@ -4615,8 +4615,8 @@ def zrevrangebylex(
46154615
name: KeyT,
46164616
max: EncodableT,
46174617
min: EncodableT,
4618-
start: Optional[None] = None,
4619-
num: Optional[None] = None,
4618+
start: Optional[int] = None,
4619+
num: Optional[int] = None,
46204620
) -> ResponseT:
46214621
"""
46224622
Return the reversed lexicographical range of values from sorted set
@@ -4639,8 +4639,8 @@ def zrangebyscore(
46394639
name: KeyT,
46404640
min: ZScoreBoundT,
46414641
max: ZScoreBoundT,
4642-
start: Optional[None] = None,
4643-
num: Optional[None] = None,
4642+
start: Optional[int] = None,
4643+
num: Optional[int] = None,
46444644
withscores: bool = False,
46454645
score_cast_func: Union[type, Callable] = float,
46464646
) -> ResponseT:
@@ -4674,8 +4674,8 @@ def zrevrangebyscore(
46744674
name: KeyT,
46754675
max: ZScoreBoundT,
46764676
min: ZScoreBoundT,
4677-
start: Optional[None] = None,
4678-
num: Optional[None] = None,
4677+
start: Optional[int] = None,
4678+
num: Optional[int] = None,
46794679
withscores: bool = False,
46804680
score_cast_func: Union[type, Callable] = float,
46814681
):
@@ -6040,7 +6040,7 @@ def georadius(
60406040
withdist: bool = False,
60416041
withcoord: bool = False,
60426042
withhash: bool = False,
6043-
count: Optional[None] = None,
6043+
count: Optional[int] = None,
60446044
sort: Optional[str] = None,
60456045
store: Optional[KeyT] = None,
60466046
store_dist: Optional[KeyT] = None,
@@ -6102,7 +6102,7 @@ def georadiusbymember(
61026102
withdist: bool = False,
61036103
withcoord: bool = False,
61046104
withhash: bool = False,
6105-
count: Optional[None] = None,
6105+
count: Optional[int] = None,
61066106
sort: Optional[str] = None,
61076107
store: Union[KeyT, None] = None,
61086108
store_dist: Union[KeyT, None] = None,
@@ -6189,7 +6189,7 @@ def geosearch(
61896189
width: Union[float, None] = None,
61906190
height: Union[float, None] = None,
61916191
sort: Optional[str] = None,
6192-
count: Optional[None] = None,
6192+
count: Optional[int] = None,
61936193
any: bool = False,
61946194
withcoord: bool = False,
61956195
withdist: bool = False,

0 commit comments

Comments
 (0)