Skip to content

Commit

Permalink
raise an exception if query TIMEOUT is a non negative integer
Browse files Browse the repository at this point in the history
  • Loading branch information
meiravgri committed Sep 12, 2023
1 parent b59492b commit 3fb2c68
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion redis/commands/search/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,10 @@ def _get_args_tags(self):
args += self._ids
if self._slop >= 0:
args += ["SLOP", self._slop]
if self._timeout is not None:
if isinstance(self._timeout, int) and self._timeout >= 0:
args += ["TIMEOUT", self._timeout]
else:
raise AttributeError("TIMEOUT requires a non negative integer.")
if self._in_order:
args.append("INORDER")
if self._return_fields:
Expand Down

0 comments on commit 3fb2c68

Please sign in to comment.