syedahsn commented on code in PR #32513:
URL: https://github.com/apache/airflow/pull/32513#discussion_r1261792096
##########
airflow/providers/amazon/aws/hooks/emr.py:
##########
@@ -284,13 +289,16 @@ def cancel_running_jobs(self, application_id: str,
waiter_config: dict = {}):
)
for job_id in job_ids:
self.conn.cancel_job_run(applicationId=application_id,
jobRunId=job_id)
- if count > 0:
- self.log.info("now waiting for the %s cancelled job(s) to
terminate", count)
- self.get_waiter("no_job_running").wait(
- applicationId=application_id,
-
states=list(self.JOB_INTERMEDIATE_STATES.union({"CANCELLING"})),
- WaiterConfig=waiter_config,
- )
+ if wait_for_completion:
+ if count > 0:
+ self.log.info("now waiting for the %s cancelled job(s) to
terminate", count)
+ self.get_waiter("no_job_running").wait(
+ applicationId=application_id,
+
states=list(self.JOB_INTERMEDIATE_STATES.union({"CANCELLING"})),
+ WaiterConfig=waiter_config,
+ )
+
+ return count
Review Comment:
@vandonr-amz You were right about this being a breaking change. I solved
the issue by adding a `wait_for_completion` parameter. I think its a cleaner
solution anyways
--
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]