syedahsn commented on code in PR #36330:
URL: https://github.com/apache/airflow/pull/36330#discussion_r1453750389


##########
airflow/providers/amazon/aws/operators/batch.py:
##########
@@ -255,11 +255,16 @@ def execute(self, context: Context):
 
         return self.job_id
 
-    def execute_complete(self, context, event=None):
+    def execute_complete(self, context: Context, event: dict[str, Any] | None 
= None) -> str:
+        if event is None:
+            err_msg = "Trigger error: event is None"
+            self.log.info(err_msg)
+            raise AirflowException(err_msg)
+
         if event["status"] != "success":
             raise AirflowException(f"Error while running job: {event}")
-        else:
-            self.log.info("Job completed.")
+
+        self.log.info("Job completed.")

Review Comment:
   Similar to how you added more job specific information (i.e. the job id), 
you could do the same for all of these `Job completed` messages.



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