@@ -101,7 +101,7 @@ def acl_genpass(self, bits: Union[int, None] = None, **kwargs) -> ResponseT:
101101 raise ValueError
102102 except ValueError :
103103 raise DataError (
104- "genpass optionally accepts a bits argument, " " between 0 and 4096."
104+ "genpass optionally accepts a bits argument, between 0 and 4096."
105105 )
106106 return self .execute_command ("ACL GENPASS" , * pieces , ** kwargs )
107107
@@ -142,7 +142,7 @@ def acl_log(self, count: Union[int, None] = None, **kwargs) -> ResponseT:
142142 args = []
143143 if count is not None :
144144 if not isinstance (count , int ):
145- raise DataError ("ACL LOG count must be an " " integer" )
145+ raise DataError ("ACL LOG count must be an integer" )
146146 args .append (count )
147147
148148 return self .execute_command ("ACL LOG" , * args , ** kwargs )
@@ -276,7 +276,7 @@ def acl_setuser(
276276
277277 if (passwords or hashed_passwords ) and nopass :
278278 raise DataError (
279- "Cannot set 'nopass' and supply " " 'passwords' or 'hashed_passwords'"
279+ "Cannot set 'nopass' and supply 'passwords' or 'hashed_passwords'"
280280 )
281281
282282 if passwords :
@@ -980,6 +980,34 @@ def lastsave(self, **kwargs) -> ResponseT:
980980 """
981981 return self .execute_command ("LASTSAVE" , ** kwargs )
982982
983+ def latency_doctor (self ):
984+ """Raise a NotImplementedError, as the client will not support LATENCY DOCTOR.
985+ This funcion is best used within the redis-cli.
986+
987+ For more information see https://redis.io/commands/latency-doctor
988+ """
989+ raise NotImplementedError (
990+ """
991+ LATENCY DOCTOR is intentionally not implemented in the client.
992+
993+ For more information see https://redis.io/commands/latency-doctor
994+ """
995+ )
996+
997+ def latency_graph (self ):
998+ """Raise a NotImplementedError, as the client will not support LATENCY GRAPH.
999+ This funcion is best used within the redis-cli.
1000+
1001+ For more information see https://redis.io/commands/latency-graph.
1002+ """
1003+ raise NotImplementedError (
1004+ """
1005+ LATENCY GRAPH is intentionally not implemented in the client.
1006+
1007+ For more information see https://redis.io/commands/latency-graph
1008+ """
1009+ )
1010+
9831011 def lolwut (self , * version_numbers : Union [str , float ], ** kwargs ) -> ResponseT :
9841012 """
9851013 Get the Redis version and a piece of generative computer art
@@ -1123,6 +1151,30 @@ def latency_histogram(self, *args):
11231151 "LATENCY HISTOGRAM is intentionally not implemented in the client."
11241152 )
11251153
1154+ def latency_history (self , event : str ) -> ResponseT :
1155+ """
1156+ Returns the raw data of the ``event``'s latency spikes time series.
1157+
1158+ For more information see https://redis.io/commands/latency-history
1159+ """
1160+ return self .execute_command ("LATENCY HISTORY" , event )
1161+
1162+ def latency_latest (self ) -> ResponseT :
1163+ """
1164+ Reports the latest latency events logged.
1165+
1166+ For more information see https://redis.io/commands/latency-latest
1167+ """
1168+ return self .execute_command ("LATENCY LATEST" )
1169+
1170+ def latency_reset (self , * events : str ) -> ResponseT :
1171+ """
1172+ Resets the latency spikes time series of all, or only some, events.
1173+
1174+ For more information see https://redis.io/commands/latency-reset
1175+ """
1176+ return self .execute_command ("LATENCY RESET" , * events )
1177+
11261178 def ping (self , ** kwargs ) -> ResponseT :
11271179 """
11281180 Ping the Redis server
@@ -1561,7 +1613,7 @@ def bitpos(
15611613 if start is not None and end is not None :
15621614 params .append (end )
15631615 elif start is None and end is not None :
1564- raise DataError ("start argument is not set, " " when end is specified" )
1616+ raise DataError ("start argument is not set, when end is specified" )
15651617
15661618 if mode is not None :
15671619 params .append (mode )
@@ -3405,9 +3457,7 @@ def xadd(
34053457 """
34063458 pieces : list [EncodableT ] = []
34073459 if maxlen is not None and minid is not None :
3408- raise DataError (
3409- "Only one of ```maxlen``` or ```minid``` " "may be specified"
3410- )
3460+ raise DataError ("Only one of ```maxlen``` or ```minid``` may be specified" )
34113461
34123462 if maxlen is not None :
34133463 if not isinstance (maxlen , int ) or maxlen < 1 :
@@ -3463,7 +3513,7 @@ def xautoclaim(
34633513 try :
34643514 if int (min_idle_time ) < 0 :
34653515 raise DataError (
3466- "XAUTOCLAIM min_idle_time must be a non" "negative integer"
3516+ "XAUTOCLAIM min_idle_time must be a nonnegative integer"
34673517 )
34683518 except TypeError :
34693519 pass
@@ -3521,7 +3571,7 @@ def xclaim(
35213571 For more information see https://redis.io/commands/xclaim
35223572 """
35233573 if not isinstance (min_idle_time , int ) or min_idle_time < 0 :
3524- raise DataError ("XCLAIM min_idle_time must be a non negative " " integer" )
3574+ raise DataError ("XCLAIM min_idle_time must be a non negative integer" )
35253575 if not isinstance (message_ids , (list , tuple )) or not message_ids :
35263576 raise DataError (
35273577 "XCLAIM message_ids must be a non empty list or "
@@ -3854,7 +3904,7 @@ def xreadgroup(
38543904 pieces .append (str (count ))
38553905 if block is not None :
38563906 if not isinstance (block , int ) or block < 0 :
3857- raise DataError ("XREADGROUP block must be a non-negative " " integer" )
3907+ raise DataError ("XREADGROUP block must be a non-negative integer" )
38583908 pieces .append (b"BLOCK" )
38593909 pieces .append (str (block ))
38603910 if noack :
@@ -3916,7 +3966,7 @@ def xtrim(
39163966 """
39173967 pieces : list [EncodableT ] = []
39183968 if maxlen is not None and minid is not None :
3919- raise DataError ("Only one of ``maxlen`` or ``minid`` " " may be specified" )
3969+ raise DataError ("Only one of ``maxlen`` or ``minid`` may be specified" )
39203970
39213971 if maxlen is None and minid is None :
39223972 raise DataError ("One of ``maxlen`` or ``minid`` must be specified" )
@@ -4290,14 +4340,12 @@ def _zrange(
42904340 num : Union [int , None ] = None ,
42914341 ) -> ResponseT :
42924342 if byscore and bylex :
4293- raise DataError (
4294- "``byscore`` and ``bylex`` can not be " "specified together."
4295- )
4343+ raise DataError ("``byscore`` and ``bylex`` can not be specified together." )
42964344 if (offset is not None and num is None ) or (num is not None and offset is None ):
42974345 raise DataError ("``offset`` and ``num`` must both be specified." )
42984346 if bylex and withscores :
42994347 raise DataError (
4300- "``withscores`` not supported in combination " " with ``bylex``."
4348+ "``withscores`` not supported in combination with ``bylex``."
43014349 )
43024350 pieces = [command ]
43034351 if dest :
@@ -5249,7 +5297,7 @@ def geoadd(
52495297 if nx and xx :
52505298 raise DataError ("GEOADD allows either 'nx' or 'xx', not both" )
52515299 if len (values ) % 3 != 0 :
5252- raise DataError ("GEOADD requires places with lon, lat and name" " values" )
5300+ raise DataError ("GEOADD requires places with lon, lat and name values" )
52535301 pieces = [name ]
52545302 if nx :
52555303 pieces .append ("NX" )
@@ -5435,7 +5483,7 @@ def _georadiusgeneric(
54355483 raise DataError ("GEORADIUS invalid sort" )
54365484
54375485 if kwargs ["store" ] and kwargs ["store_dist" ]:
5438- raise DataError ("GEORADIUS store and store_dist cant be set" " together" )
5486+ raise DataError ("GEORADIUS store and store_dist cant be set together" )
54395487
54405488 if kwargs ["store" ]:
54415489 pieces .extend ([b"STORE" , kwargs ["store" ]])
@@ -5572,13 +5620,11 @@ def _geosearchgeneric(
55725620 # FROMMEMBER or FROMLONLAT
55735621 if kwargs ["member" ] is None :
55745622 if kwargs ["longitude" ] is None or kwargs ["latitude" ] is None :
5575- raise DataError (
5576- "GEOSEARCH must have member or" " longitude and latitude"
5577- )
5623+ raise DataError ("GEOSEARCH must have member or longitude and latitude" )
55785624 if kwargs ["member" ]:
55795625 if kwargs ["longitude" ] or kwargs ["latitude" ]:
55805626 raise DataError (
5581- "GEOSEARCH member and longitude or latitude" " cant be set together"
5627+ "GEOSEARCH member and longitude or latitude cant be set together"
55825628 )
55835629 pieces .extend ([b"FROMMEMBER" , kwargs ["member" ]])
55845630 if kwargs ["longitude" ] is not None and kwargs ["latitude" ] is not None :
@@ -5587,15 +5633,15 @@ def _geosearchgeneric(
55875633 # BYRADIUS or BYBOX
55885634 if kwargs ["radius" ] is None :
55895635 if kwargs ["width" ] is None or kwargs ["height" ] is None :
5590- raise DataError ("GEOSEARCH must have radius or" " width and height" )
5636+ raise DataError ("GEOSEARCH must have radius or width and height" )
55915637 if kwargs ["unit" ] is None :
55925638 raise DataError ("GEOSEARCH must have unit" )
55935639 if kwargs ["unit" ].lower () not in ("m" , "km" , "mi" , "ft" ):
55945640 raise DataError ("GEOSEARCH invalid unit" )
55955641 if kwargs ["radius" ]:
55965642 if kwargs ["width" ] or kwargs ["height" ]:
55975643 raise DataError (
5598- "GEOSEARCH radius and width or height" " cant be set together"
5644+ "GEOSEARCH radius and width or height cant be set together"
55995645 )
56005646 pieces .extend ([b"BYRADIUS" , kwargs ["radius" ], kwargs ["unit" ]])
56015647 if kwargs ["width" ] and kwargs ["height" ]:
@@ -5616,7 +5662,7 @@ def _geosearchgeneric(
56165662 if kwargs ["any" ]:
56175663 pieces .append (b"ANY" )
56185664 elif kwargs ["any" ]:
5619- raise DataError ("GEOSEARCH ``any`` can't be provided " " without count" )
5665+ raise DataError ("GEOSEARCH ``any`` can't be provided without count" )
56205666
56215667 # other properties
56225668 for arg_name , byte_repr in (
0 commit comments