Copilot commented on code in PR #56158:
URL: https://github.com/apache/airflow/pull/56158#discussion_r2384375000
##########
providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -698,19 +697,22 @@ def __init__(
super().__init__(**kwargs)
self.emr_conn_id = emr_conn_id
self.job_flow_overrides = job_flow_overrides or {}
- self.wait_policy = wait_policy
+ self.wait_for_completion = wait_for_completion
self.waiter_max_attempts = waiter_max_attempts or 60
self.waiter_delay = waiter_delay or 60
self.deferrable = deferrable
- if wait_for_completion is not None:
+ if wait_policy is not None:
warnings.warn(
- "`wait_for_completion` parameter is deprecated, please use
`wait_policy` instead.",
+ "`wait_policy` parameter is deprecated, please use
`wait_for_completion` instead.",
AirflowProviderDeprecationWarning,
stacklevel=2,
)
- # preserve previous behaviour
- self.wait_policy = WaitPolicy.WAIT_FOR_COMPLETION if
wait_for_completion else None
+ self.wait_policy = wait_policy
+ self.wait_for_completion = wait_policy in (
+ WaitPolicy.WAIT_FOR_COMPLETION,
+ WaitPolicy.WAIT_FOR_STEPS_COMPLETION,
+ )
Review Comment:
The `wait_policy` is still being stored but never used in the execute
method. Consider removing this assignment since the execute method now only
uses `wait_for_completion`, or preserve the original waiter selection logic to
maintain full backward compatibility.
--
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]