diff options
-rw-r--r-- | redis/commands/core.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py index 771fed9..ab246a7 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -3842,7 +3842,7 @@ class StreamCommands(CommandsProtocol): 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, @@ -3863,6 +3863,9 @@ class StreamCommands(CommandsProtocol): 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: |