You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/10 06:30:12 UTC

[GitHub] [airflow] dstandish commented on a change in pull request #19504: Do not check for key before attempting download

dstandish commented on a change in pull request #19504:
URL: https://github.com/apache/airflow/pull/19504#discussion_r746281750



##########
File path: airflow/providers/amazon/aws/hooks/s3.py
##########
@@ -806,10 +806,15 @@ def download_file(
         """
         self.log.info('Downloading source S3 file from Bucket %s with path %s', bucket_name, key)
 
-        if not self.check_for_key(key, bucket_name):
-            raise AirflowException(f'The source file in Bucket {bucket_name} with path {key} does not exist')
-
-        s3_obj = self.get_key(key, bucket_name)
+        try:
+            s3_obj = self.get_key(key, bucket_name)
+        except ClientError as e:

Review comment:
       my preference would be to not catch this error at all, but catching it keeps this consistent with the existing behavior




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