Skip to content

Commit abc4176

Browse files
PostgresNode::poll_query_until is updated (typing) (postgrespro#345)
sleep_time is typing.Union[int, float]
1 parent 2f5cba5 commit abc4176

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/node.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ def poll_query_until(self,
16211621
dbname=None,
16221622
username=None,
16231623
max_attempts=0,
1624-
sleep_time=1,
1624+
sleep_time: typing.Union[int, float] = 1,
16251625
expected=True,
16261626
commit=True,
16271627
suppress=None):
@@ -1647,7 +1647,9 @@ def poll_query_until(self,
16471647
"""
16481648

16491649
# sanity checks
1650+
assert type(max_attempts) == int # noqa: E721
16501651
assert max_attempts >= 0
1652+
assert type(sleep_time) in [int, float]
16511653
assert sleep_time > 0
16521654
attempts = 0
16531655
while max_attempts == 0 or attempts < max_attempts:

0 commit comments

Comments
 (0)