This is an automated email from the ASF dual-hosted git repository.

onikolas pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new a09d0c4e38 do not fail operator if we cannot find logs (#34570)
a09d0c4e38 is described below

commit a09d0c4e3885282861d6fd42121e4a4641519374
Author: RaphaĆ«l Vandon <[email protected]>
AuthorDate: Tue Sep 26 11:21:10 2023 -0700

    do not fail operator if we cannot find logs (#34570)
    
    * do not fail operator if we cannot find logs
    
    ---------
    
    Co-authored-by: Niko Oliveira <[email protected]>
---
 airflow/providers/amazon/aws/operators/batch.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/airflow/providers/amazon/aws/operators/batch.py 
b/airflow/providers/amazon/aws/operators/batch.py
index 23d245ae7b..7cf2cbfeac 100644
--- a/airflow/providers/amazon/aws/operators/batch.py
+++ b/airflow/providers/amazon/aws/operators/batch.py
@@ -359,7 +359,12 @@ class BatchOperator(BaseOperator):
             else:
                 self.hook.wait_for_job(self.job_id)
 
-        awslogs = self.hook.get_job_all_awslogs_info(self.job_id)
+        awslogs = []
+        try:
+            awslogs = self.hook.get_job_all_awslogs_info(self.job_id)
+        except AirflowException as ae:
+            self.log.warning("Cannot determine where to find the AWS logs for 
this Batch job: %s", ae)
+
         if awslogs:
             self.log.info("AWS Batch job (%s) CloudWatch Events details found. 
Links to logs:", self.job_id)
             link_builder = CloudWatchEventsLink()

Reply via email to