Skip to content

Commit

Permalink
Added required argument to lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
vladvildanov committed Aug 9, 2024
1 parent b9e239e commit 8766123
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions redis/_parsers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand All @@ -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):
Expand Down Expand Up @@ -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]
Expand All @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)),
Expand All @@ -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,
Expand Down

0 comments on commit 8766123

Please sign in to comment.