Copilot commented on code in PR #56158:
URL: https://github.com/apache/airflow/pull/56158#discussion_r2384296825


##########
providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -748,8 +747,8 @@ def execute(self, context: Context) -> str | None:
                 job_flow_id=self._job_flow_id,
                 log_uri=get_log_uri(emr_client=self.hook.conn, 
job_flow_id=self._job_flow_id),
             )
-        if self.wait_policy:
-            waiter_name = WAITER_POLICY_NAME_MAPPING[self.wait_policy]
+        if self.wait_for_completion:
+            waiter_name = 
WAITER_POLICY_NAME_MAPPING[WaitPolicy.WAIT_FOR_COMPLETION]

Review Comment:
   The code hardcodes `WaitPolicy.WAIT_FOR_COMPLETION`, removing support for 
`WaitPolicy.WAIT_FOR_STEPS_COMPLETION` that was previously available through 
the `wait_policy` parameter. This is a breaking change that eliminates 
functionality.



##########
providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -698,19 +697,19 @@ 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_for_completion = wait_policy == 
WaitPolicy.WAIT_FOR_COMPLETION

Review Comment:
   The backward compatibility mapping only handles 
`WaitPolicy.WAIT_FOR_COMPLETION`, but ignores 
`WaitPolicy.WAIT_FOR_STEPS_COMPLETION`. Users with 
`wait_policy=WaitPolicy.WAIT_FOR_STEPS_COMPLETION` will have their 
configuration silently changed to `wait_for_completion=False`, losing the steps 
completion functionality.



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