ferruzzi commented on code in PR #29822:
URL: https://github.com/apache/airflow/pull/29822#discussion_r1120809487


##########
airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -204,8 +224,12 @@ def __init__(
         self.wait_for_completion = wait_for_completion
         self.cluster_id = cluster_id
         self.aws_conn_id = aws_conn_id
-        self.waiter_countdown = waiter_countdown
-        self.waiter_check_interval_seconds = waiter_check_interval_seconds
+        self.waiter_max_attempts = (
+            (waiter_countdown // waiter_check_interval_seconds)
+            if waiter_max_attempts is NOTSET
+            else waiter_max_attempts
+        )
+        self.waiter_delay = waiter_check_interval_seconds if waiter_delay is 
NOTSET else NOTSET

Review Comment:
   This logic could be way cleaner if NOTSET returned a falsy value.  Slack 
thread to discuss that change 
[here](https://apache-airflow.slack.com/archives/CCPRP7943/p1677618632397219).  
Currently NOTSET does not have a `__bool__` method so `self.waiter_delay = 
waiter_delay or waiter_check_interval_seconds` would set `self.waiter_delay` to 
NOTSET.



-- 
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]

Reply via email to