uranusjr commented on code in PR #33631:
URL: https://github.com/apache/airflow/pull/33631#discussion_r1302353775
##########
airflow/providers/google/cloud/hooks/mlengine.py:
##########
@@ -65,13 +65,13 @@ def _poll_with_exponential_delay(
log.info("Operation is done: %s", response)
return response
- time.sleep((2**i) + (random.randint(0, 1000) / 1000))
+ time.sleep((2**i) + random.random())
Review Comment:
This is ever so slightly different—the `randint` version can produce exactly
1, while `random` can’t. I don’t know if this would be relevant though.
##########
airflow/providers/google/cloud/hooks/mlengine.py:
##########
@@ -65,13 +65,13 @@ def _poll_with_exponential_delay(
log.info("Operation is done: %s", response)
return response
- time.sleep((2**i) + (random.randint(0, 1000) / 1000))
+ time.sleep((2**i) + random.random())
Review Comment:
This is ever so slightly different—the `randint` version can produce exactly
1, while `random` can’t. I don’t know if this would be relevant though.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]