Skip to content

Commit d088ce2

Browse files
committed
added checks for mutually exclusive parameters in set
Signed-off-by: amirreza <[email protected]>
1 parent 013fef0 commit d088ce2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

valkey/commands/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,6 +2287,11 @@ def set(
22872287
22882288
For more information see https://valkey.io/commands/set
22892289
"""
2290+
params = sum(op is not None for op in [ex, px, exat, pxat])
2291+
if params > 1:
2292+
raise DataError(
2293+
"``ex``, ``px``, ``exat`` and ``pxat`` " "are mutually exclusive."
2294+
)
22902295
pieces: list[EncodableT] = [name, value]
22912296
options = {}
22922297
if ex is not None:

0 commit comments

Comments
 (0)