kaxil commented on a change in pull request #19504:
URL: https://github.com/apache/airflow/pull/19504#discussion_r746812972
##########
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:
+ if e.response.get('Error', {}).get('Code', {}) == 404:
Review comment:
```suggestion
if e.response.get('Error', {}).get('Code') == 404:
```
Should be fine I think
--
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]