Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5017,14 +5017,16 @@ def hset(
"""
if key is None and not mapping and not items:
raise DataError("'hset' with no key value pairs")
items = items or []
pieces = []
if items:
pieces.extend(items)
if key is not None:
items.extend((key, value))
pieces.extend((key, value))
if mapping:
for pair in mapping.items():
items.extend(pair)
pieces.extend(pair)

return self.execute_command("HSET", name, *items)
return self.execute_command("HSET", name, *pieces)

def hsetnx(self, name: str, key: str, value: str) -> Union[Awaitable[bool], bool]:
"""
Expand Down