Skip to content

Commit

Permalink
added checks for mutually exclusive parameters in set
Browse files Browse the repository at this point in the history
Signed-off-by: amirreza <[email protected]>
  • Loading branch information
amirreza8002 committed Dec 12, 2024
1 parent 013fef0 commit d088ce2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions valkey/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2287,6 +2287,11 @@ def set(
For more information see https://valkey.io/commands/set
"""
params = sum(op is not None for op in [ex, px, exat, pxat])
if params > 1:
raise DataError(
"``ex``, ``px``, ``exat`` and ``pxat`` " "are mutually exclusive."
)
pieces: list[EncodableT] = [name, value]
options = {}
if ex is not None:
Expand Down

0 comments on commit d088ce2

Please sign in to comment.