uranusjr commented on code in PR #73015:
URL: https://github.com/apache/airflow/pull/73015#discussion_r4410439700
##########
providers/amazon/src/airflow/providers/amazon/aws/bundles/s3.py:
##########
@@ -79,7 +123,12 @@ def _initialize(self):
if not self.s3_hook.check_for_bucket(bucket_name=self.bucket_name):
raise AirflowException(f"S3 bucket '{self.bucket_name}' does
not exist.")
- if self.prefix:
+ if self.archive_key:
+ if not self.s3_hook.check_for_key(key=self.archive_key,
bucket_name=self.bucket_name):
+ raise AirflowNotFoundException(
+ f"S3 archive
's3://{self.bucket_name}/{self.archive_key}' does not exist."
+ )
Review Comment:
This adds an HEAD on every `__init__`, and there’s another one immediately
in `_refresh_from_archive`. Just let the HEAD in refresh raise.
Also, this raises a different exception type from the prefix check below.
--
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]