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
5 changes: 4 additions & 1 deletion redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3842,7 +3842,7 @@ def xrevrange(
def xtrim(
self,
name: KeyT,
maxlen: Union[int, None],
maxlen: Union[int, None] = None,
approximate: bool = True,
minid: Union[StreamIdT, None] = None,
limit: Union[int, None] = None,
Expand All @@ -3863,6 +3863,9 @@ def xtrim(
if maxlen is not None and minid is not None:
raise DataError("Only one of ``maxlen`` or ``minid`` " "may be specified")

if maxlen is None and minid is None:
raise DataError("One of ``maxlen`` or ``minid`` must be specified")

if maxlen is not None:
pieces.append(b"MAXLEN")
if minid is not None:
Expand Down