diff options
-rwxr-xr-x | redis/client.py | 4 | ||||
-rw-r--r-- | tests/test_commands.py | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index 79a7bff..c43a388 100755 --- a/redis/client.py +++ b/redis/client.py @@ -420,9 +420,13 @@ def parse_slowlog_get(response, **options): # an O(N) complexity) instead of the command. if isinstance(item[3], list): result["command"] = space.join(item[3]) + result["client_address"] = item[4] + result["client_name"] = item[5] else: result["complexity"] = item[3] result["command"] = space.join(item[4]) + result["client_address"] = item[5] + result["client_name"] = item[6] return result return [parse_item(item) for item in response] diff --git a/tests/test_commands.py b/tests/test_commands.py index 2b769be..4020f5e 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -861,6 +861,8 @@ class TestRedisCommands: # make sure other attributes are typed correctly assert isinstance(slowlog[0]["start_time"], int) assert isinstance(slowlog[0]["duration"], int) + assert isinstance(slowlog[0]["client_address"], bytes) + assert isinstance(slowlog[0]["client_name"], bytes) # Mock result if we didn't get slowlog complexity info. if "complexity" not in slowlog[0]: |