@@ -333,6 +333,16 @@ def bgsave(self, schedule=True, **kwargs):
333
333
pieces .append ("SCHEDULE" )
334
334
return self .execute_command ("BGSAVE" , * pieces , ** kwargs )
335
335
336
+ def role (self ):
337
+ """
338
+ Provide information on the role of a Redis instance in
339
+ the context of replication, by returning if the instance
340
+ is currently a master, slave, or sentinel.
341
+
342
+ For more information check https://redis.io/commands/role
343
+ """
344
+ return self .execute_command ("ROLE" )
345
+
336
346
def client_kill (self , address , ** kwargs ):
337
347
"""Disconnects the client at ``address`` (ip:port)
338
348
@@ -864,11 +874,15 @@ def slowlog_get(self, num=None, **kwargs):
864
874
865
875
For more information check https://redis.io/commands/slowlog-get
866
876
"""
877
+ from redis .client import NEVER_DECODE
878
+
867
879
args = ["SLOWLOG GET" ]
868
880
if num is not None :
869
881
args .append (num )
870
882
decode_responses = self .get_connection_kwargs ().get ("decode_responses" , False )
871
- return self .execute_command (* args , decode_responses = decode_responses , ** kwargs )
883
+ if decode_responses is True :
884
+ kwargs [NEVER_DECODE ] = []
885
+ return self .execute_command (* args , ** kwargs )
872
886
873
887
def slowlog_len (self , ** kwargs ):
874
888
"""
0 commit comments