You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "o-nikolas (via GitHub)" <gi...@apache.org> on 2023/09/22 22:20:16 UTC

[GitHub] [airflow] o-nikolas commented on a diff in pull request #34570: do not fail operator if we cannot find logs

o-nikolas commented on code in PR #34570:
URL: https://github.com/apache/airflow/pull/34570#discussion_r1334855291


##########
airflow/providers/amazon/aws/operators/batch.py:
##########
@@ -359,7 +359,12 @@ def monitor_job(self, context: Context):
             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 aws logs for this batch job: %s", ae)

Review Comment:
   
   ```suggestion
               self.log.warning("Cannot determine where to find the AWS logs for this Batch job: %s", ae)
   ```
   
   Also are we sure all cases of AirflowException are safe to catch and warn on here? Or should we check the message to ensure it's the specific case you're describing in the log message?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org