Lee-W commented on code in PR #36330:
URL: https://github.com/apache/airflow/pull/36330#discussion_r1490797956
##########
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:
I think it might be better if we do this in another PR. This PR intends to
improve type annotation
--
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]