@@ -502,10 +502,7 @@ def client_info(self, **kwargs) -> ResponseT:
502
502
return self .execute_command ("CLIENT INFO" , ** kwargs )
503
503
504
504
def client_list (
505
- self ,
506
- _type : Union [str , None ] = None ,
507
- client_id : List [EncodableT ] = [],
508
- ** kwargs ,
505
+ self , _type : Union [str , None ] = None , client_id : List [EncodableT ] = [], ** kwargs
509
506
) -> ResponseT :
510
507
"""
511
508
Returns a list of currently connected clients.
@@ -548,9 +545,7 @@ def client_getredir(self, **kwargs) -> ResponseT:
548
545
return self .execute_command ("CLIENT GETREDIR" , ** kwargs )
549
546
550
547
def client_reply (
551
- self ,
552
- reply : Union [Literal ["ON" ], Literal ["OFF" ], Literal ["SKIP" ]],
553
- ** kwargs ,
548
+ self , reply : Union [Literal ["ON" ], Literal ["OFF" ], Literal ["SKIP" ]], ** kwargs
554
549
) -> ResponseT :
555
550
"""
556
551
Enable and disable redis server replies.
@@ -696,10 +691,7 @@ def client_setname(self, name: str, **kwargs) -> ResponseT:
696
691
return self .execute_command ("CLIENT SETNAME" , name , ** kwargs )
697
692
698
693
def client_unblock (
699
- self ,
700
- client_id : int ,
701
- error : bool = False ,
702
- ** kwargs ,
694
+ self , client_id : int , error : bool = False , ** kwargs
703
695
) -> ResponseT :
704
696
"""
705
697
Unblocks a connection by its client id.
@@ -1475,12 +1467,7 @@ def bitfield(
1475
1467
"""
1476
1468
return BitFieldOperation (self , key , default_overflow = default_overflow )
1477
1469
1478
- def bitop (
1479
- self ,
1480
- operation : str ,
1481
- dest : KeyT ,
1482
- * keys : KeyT ,
1483
- ) -> ResponseT :
1470
+ def bitop (self , operation : str , dest : KeyT , * keys : KeyT ) -> ResponseT :
1484
1471
"""
1485
1472
Perform a bitwise operation using ``operation`` between ``keys`` and
1486
1473
store the result in ``dest``.
@@ -1826,11 +1813,7 @@ def keys(self, pattern: PatternT = "*", **kwargs) -> ResponseT:
1826
1813
return self .execute_command ("KEYS" , pattern , ** kwargs )
1827
1814
1828
1815
def lmove (
1829
- self ,
1830
- first_list : str ,
1831
- second_list : str ,
1832
- src : str = "LEFT" ,
1833
- dest : str = "RIGHT" ,
1816
+ self , first_list : str , second_list : str , src : str = "LEFT" , dest : str = "RIGHT"
1834
1817
) -> ResponseT :
1835
1818
"""
1836
1819
Atomically returns and removes the first/last element of a list,
@@ -1996,12 +1979,7 @@ def pexpiretime(self, key: str) -> int:
1996
1979
"""
1997
1980
return self .execute_command ("PEXPIRETIME" , key )
1998
1981
1999
- def psetex (
2000
- self ,
2001
- name : KeyT ,
2002
- time_ms : ExpiryT ,
2003
- value : EncodableT ,
2004
- ):
1982
+ def psetex (self , name : KeyT , time_ms : ExpiryT , value : EncodableT ):
2005
1983
"""
2006
1984
Set the value of key ``name`` to ``value`` that expires in ``time_ms``
2007
1985
milliseconds. ``time_ms`` can be represented by an integer or a Python
@@ -2022,10 +2000,7 @@ def pttl(self, name: KeyT) -> ResponseT:
2022
2000
return self .execute_command ("PTTL" , name )
2023
2001
2024
2002
def hrandfield (
2025
- self ,
2026
- key : str ,
2027
- count : int = None ,
2028
- withvalues : bool = False ,
2003
+ self , key : str , count : int = None , withvalues : bool = False
2029
2004
) -> ResponseT :
2030
2005
"""
2031
2006
Return a random field from the hash value stored at key.
@@ -2240,12 +2215,7 @@ def setnx(self, name: KeyT, value: EncodableT) -> ResponseT:
2240
2215
"""
2241
2216
return self .execute_command ("SETNX" , name , value )
2242
2217
2243
- def setrange (
2244
- self ,
2245
- name : KeyT ,
2246
- offset : int ,
2247
- value : EncodableT ,
2248
- ) -> ResponseT :
2218
+ def setrange (self , name : KeyT , offset : int , value : EncodableT ) -> ResponseT :
2249
2219
"""
2250
2220
Overwrite bytes in the value of ``name`` starting at ``offset`` with
2251
2221
``value``. If ``offset`` plus the length of ``value`` exceeds the
@@ -3259,10 +3229,7 @@ def smembers(self, name: str) -> Union[Awaitable[list], list]:
3259
3229
return self .execute_command ("SMEMBERS" , name )
3260
3230
3261
3231
def smismember (
3262
- self ,
3263
- name : str ,
3264
- values : List ,
3265
- * args : List ,
3232
+ self , name : str , values : List , * args : List
3266
3233
) -> Union [Awaitable [List [bool ]], List [bool ]]:
3267
3234
"""
3268
3235
Return whether each value in ``values`` is a member of the set ``name``
@@ -3291,9 +3258,7 @@ def spop(self, name: str, count: Optional[int] = None) -> Union[str, List, None]
3291
3258
return self .execute_command ("SPOP" , name , * args )
3292
3259
3293
3260
def srandmember (
3294
- self ,
3295
- name : str ,
3296
- number : Optional [int ] = None ,
3261
+ self , name : str , number : Optional [int ] = None
3297
3262
) -> Union [str , List , None ]:
3298
3263
"""
3299
3264
If ``number`` is None, returns a random member of set ``name``.
@@ -3346,12 +3311,7 @@ class StreamCommands(CommandsProtocol):
3346
3311
see: https://redis.io/topics/streams-intro
3347
3312
"""
3348
3313
3349
- def xack (
3350
- self ,
3351
- name : KeyT ,
3352
- groupname : GroupT ,
3353
- * ids : StreamIdT ,
3354
- ) -> ResponseT :
3314
+ def xack (self , name : KeyT , groupname : GroupT , * ids : StreamIdT ) -> ResponseT :
3355
3315
"""
3356
3316
Acknowledges the successful processing of one or more messages.
3357
3317
name: name of the stream.
@@ -3576,10 +3536,7 @@ def xgroup_create(
3576
3536
return self .execute_command (* pieces )
3577
3537
3578
3538
def xgroup_delconsumer (
3579
- self ,
3580
- name : KeyT ,
3581
- groupname : GroupT ,
3582
- consumername : ConsumerT ,
3539
+ self , name : KeyT , groupname : GroupT , consumername : ConsumerT
3583
3540
) -> ResponseT :
3584
3541
"""
3585
3542
Remove a specific consumer from a consumer group.
@@ -3604,10 +3561,7 @@ def xgroup_destroy(self, name: KeyT, groupname: GroupT) -> ResponseT:
3604
3561
return self .execute_command ("XGROUP DESTROY" , name , groupname )
3605
3562
3606
3563
def xgroup_createconsumer (
3607
- self ,
3608
- name : KeyT ,
3609
- groupname : GroupT ,
3610
- consumername : ConsumerT ,
3564
+ self , name : KeyT , groupname : GroupT , consumername : ConsumerT
3611
3565
) -> ResponseT :
3612
3566
"""
3613
3567
Consumers in a consumer group are auto-created every time a new
@@ -4052,12 +4006,7 @@ def zdiffstore(self, dest: KeyT, keys: KeysT) -> ResponseT:
4052
4006
pieces = [len (keys ), * keys ]
4053
4007
return self .execute_command ("ZDIFFSTORE" , dest , * pieces )
4054
4008
4055
- def zincrby (
4056
- self ,
4057
- name : KeyT ,
4058
- amount : float ,
4059
- value : EncodableT ,
4060
- ) -> ResponseT :
4009
+ def zincrby (self , name : KeyT , amount : float , value : EncodableT ) -> ResponseT :
4061
4010
"""
4062
4011
Increment the score of ``value`` in sorted set ``name`` by ``amount``
4063
4012
@@ -4066,10 +4015,7 @@ def zincrby(
4066
4015
return self .execute_command ("ZINCRBY" , name , amount , value )
4067
4016
4068
4017
def zinter (
4069
- self ,
4070
- keys : KeysT ,
4071
- aggregate : Union [str , None ] = None ,
4072
- withscores : bool = False ,
4018
+ self , keys : KeysT , aggregate : Union [str , None ] = None , withscores : bool = False
4073
4019
) -> ResponseT :
4074
4020
"""
4075
4021
Return the intersect of multiple sorted sets specified by ``keys``.
@@ -4127,11 +4073,7 @@ def zlexcount(self, name, min, max):
4127
4073
"""
4128
4074
return self .execute_command ("ZLEXCOUNT" , name , min , max )
4129
4075
4130
- def zpopmax (
4131
- self ,
4132
- name : KeyT ,
4133
- count : Union [int , None ] = None ,
4134
- ) -> ResponseT :
4076
+ def zpopmax (self , name : KeyT , count : Union [int , None ] = None ) -> ResponseT :
4135
4077
"""
4136
4078
Remove and return up to ``count`` members with the highest scores
4137
4079
from the sorted set ``name``.
@@ -4142,11 +4084,7 @@ def zpopmax(
4142
4084
options = {"withscores" : True }
4143
4085
return self .execute_command ("ZPOPMAX" , name , * args , ** options )
4144
4086
4145
- def zpopmin (
4146
- self ,
4147
- name : KeyT ,
4148
- count : Union [int , None ] = None ,
4149
- ) -> ResponseT :
4087
+ def zpopmin (self , name : KeyT , count : Union [int , None ] = None ) -> ResponseT :
4150
4088
"""
4151
4089
Remove and return up to ``count`` members with the lowest scores
4152
4090
from the sorted set ``name``.
@@ -4158,10 +4096,7 @@ def zpopmin(
4158
4096
return self .execute_command ("ZPOPMIN" , name , * args , ** options )
4159
4097
4160
4098
def zrandmember (
4161
- self ,
4162
- key : KeyT ,
4163
- count : int = None ,
4164
- withscores : bool = False ,
4099
+ self , key : KeyT , count : int = None , withscores : bool = False
4165
4100
) -> ResponseT :
4166
4101
"""
4167
4102
Return a random element from the sorted set value stored at key.
@@ -4675,11 +4610,7 @@ def zunionstore(
4675
4610
"""
4676
4611
return self ._zaggregate ("ZUNIONSTORE" , dest , keys , aggregate )
4677
4612
4678
- def zmscore (
4679
- self ,
4680
- key : KeyT ,
4681
- members : List [str ],
4682
- ) -> ResponseT :
4613
+ def zmscore (self , key : KeyT , members : List [str ]) -> ResponseT :
4683
4614
"""
4684
4615
Returns the scores associated with the specified members
4685
4616
in the sorted set stored at key.
@@ -5264,11 +5195,7 @@ def geoadd(
5264
5195
return self .execute_command ("GEOADD" , * pieces )
5265
5196
5266
5197
def geodist (
5267
- self ,
5268
- name : KeyT ,
5269
- place1 : FieldT ,
5270
- place2 : FieldT ,
5271
- unit : Union [str , None ] = None ,
5198
+ self , name : KeyT , place1 : FieldT , place2 : FieldT , unit : Union [str , None ] = None
5272
5199
) -> ResponseT :
5273
5200
"""
5274
5201
Return the distance between ``place1`` and ``place2`` members of the
@@ -5407,20 +5334,15 @@ def georadiusbymember(
5407
5334
)
5408
5335
5409
5336
def _georadiusgeneric (
5410
- self ,
5411
- command : str ,
5412
- * args : EncodableT ,
5413
- ** kwargs : Union [EncodableT , None ],
5337
+ self , command : str , * args : EncodableT , ** kwargs : Union [EncodableT , None ]
5414
5338
) -> ResponseT :
5415
5339
pieces = list (args )
5416
5340
if kwargs ["unit" ] and kwargs ["unit" ] not in ("m" , "km" , "mi" , "ft" ):
5417
5341
raise DataError ("GEORADIUS invalid unit" )
5418
5342
elif kwargs ["unit" ]:
5419
5343
pieces .append (kwargs ["unit" ])
5420
5344
else :
5421
- pieces .append (
5422
- "m" ,
5423
- )
5345
+ pieces .append ("m" )
5424
5346
5425
5347
if kwargs ["any" ] and kwargs ["count" ] is None :
5426
5348
raise DataError ("``any`` can't be provided without ``count``" )
@@ -5577,10 +5499,7 @@ def geosearchstore(
5577
5499
)
5578
5500
5579
5501
def _geosearchgeneric (
5580
- self ,
5581
- command : str ,
5582
- * args : EncodableT ,
5583
- ** kwargs : Union [EncodableT , None ],
5502
+ self , command : str , * args : EncodableT , ** kwargs : Union [EncodableT , None ]
5584
5503
) -> ResponseT :
5585
5504
pieces = list (args )
5586
5505
@@ -5814,9 +5733,7 @@ class FunctionCommands:
5814
5733
"""
5815
5734
5816
5735
def function_load (
5817
- self ,
5818
- code : str ,
5819
- replace : Optional [bool ] = False ,
5736
+ self , code : str , replace : Optional [bool ] = False
5820
5737
) -> Union [Awaitable [str ], str ]:
5821
5738
"""
5822
5739
Load a library to Redis.
0 commit comments