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


##########
providers/amazon/src/airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -748,8 +751,11 @@ 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:
+            if hasattr(self, "wait_policy") and self.wait_policy:

Review Comment:
   The `hasattr(self, "wait_policy")` check is unnecessary since 
`self.wait_policy` is always set in the constructor when `wait_policy` 
parameter is provided. Consider simplifying this to just check `if 
self.wait_policy:` since the attribute will exist when needed.
   ```suggestion
               if self.wait_policy:
   ```



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