We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bac33d4 commit 4a73d85Copy full SHA for 4a73d85
redis/commands/core.py
@@ -3842,7 +3842,7 @@ def xrevrange(
3842
def xtrim(
3843
self,
3844
name: KeyT,
3845
- maxlen: Union[int, None],
+ maxlen: Union[int, None] = None,
3846
approximate: bool = True,
3847
minid: Union[StreamIdT, None] = None,
3848
limit: Union[int, None] = None,
@@ -3863,6 +3863,9 @@ def xtrim(
3863
if maxlen is not None and minid is not None:
3864
raise DataError("Only one of ``maxlen`` or ``minid`` " "may be specified")
3865
3866
+ if maxlen is None and minid is None:
3867
+ raise DataError("One of ``maxlen`` or ``minid`` must be specified")
3868
+
3869
if maxlen is not None:
3870
pieces.append(b"MAXLEN")
3871
if minid is not None:
0 commit comments