Skip to content

Commit 2c05ea3

Browse files
author
Joshua
committed
Add check for only one of key, mapping and items is specified
Signed-off-by: Joshua <joshua.gehlen@fkie.fraunhofer.de>
1 parent d7d8d5a commit 2c05ea3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

valkey/commands/core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5083,6 +5083,10 @@ def hsetex(
50835083

50845084
if key is None and not mapping and not items:
50855085
raise DataError("'hsetex' with no key value pairs")
5086+
if int(key is not None) + int(mapping is not None) + int(items is not None) > 1:
5087+
raise DataError(
5088+
"Only one of 'key/value', 'mapping', or 'items' can be specified."
5089+
)
50865090

50875091
if int(keepttl) + sum(arg is not None for arg in [ex, px, exat, pxat]) > 1:
50885092
raise DataError(

0 commit comments

Comments
 (0)