diff --git a/redis/_parsers/helpers.py b/redis/_parsers/helpers.py index a408a6963e..09cb833406 100644 --- a/redis/_parsers/helpers.py +++ b/redis/_parsers/helpers.py @@ -178,7 +178,7 @@ def parse_sentinel_get_master(response, **options): return response and (response[0], int(response[1])) or None -def pairs_to_dict(response, decode_keys=False, decode_string_values=False): +def pairs_to_dict(response, decode_keys=False, decode_string_values=False, **options): """Create a dict given a list of key/value pairs""" if response is None: return {} @@ -197,7 +197,7 @@ def pairs_to_dict(response, decode_keys=False, decode_string_values=False): return dict(zip(it, it)) -def pairs_to_dict_typed(response, type_info): +def pairs_to_dict_typed(response, type_info, **options): it = iter(response) result = {} for key, value in zip(it, it): @@ -442,7 +442,7 @@ def parse_cluster_info(response, **options): return dict(line.split(":") for line in response.splitlines() if line) -def _parse_node_line(line): +def _parse_node_line(line, **options): line_items = line.split(" ") node_id, addr, flags, master_id, ping, pong, epoch, connected = line.split(" ")[:8] addr = addr.split("@")[0] @@ -463,7 +463,7 @@ def _parse_node_line(line): return addr, node_dict -def _parse_slots(slot_ranges): +def _parse_slots(slot_ranges, **options): slots, migrations = [], [] for s_range in slot_ranges: if "->-" in s_range: @@ -640,7 +640,7 @@ def parse_acl_log(response, **options): return data -def parse_client_info(value): +def parse_client_info(value, **options): """ Parsing client-info in ACL Log in following format. "key1=value1 key2=value2 key3=value3" @@ -794,7 +794,7 @@ def string_keys_to_dict(key_string, callback): **string_keys_to_dict( "BZPOPMAX BZPOPMIN", lambda r: r and (r[0], r[1], float(r[2])) or None ), - "ACL CAT": lambda r: list(map(str_if_bytes, r)), + "ACL CAT": lambda r, **options: list(map(str_if_bytes, r)), "ACL GENPASS": str_if_bytes, "ACL HELP": lambda r: list(map(str_if_bytes, r)), "ACL LIST": lambda r: list(map(str_if_bytes, r)), @@ -810,7 +810,7 @@ def string_keys_to_dict(key_string, callback): "GEOPOS": lambda r: list( map(lambda ll: (float(ll[0]), float(ll[1])) if ll is not None else None, r) ), - "HGETALL": lambda r: r and pairs_to_dict(r) or {}, + "HGETALL": lambda r, **options: r and pairs_to_dict(r, False, False, **options) or {}, "MEMORY STATS": parse_memory_stats, "MODULE LIST": lambda r: [pairs_to_dict(m) for m in r], "RESET": str_if_bytes,