turbaszek commented on a change in pull request #12389:
URL: https://github.com/apache/airflow/pull/12389#discussion_r526245635
##########
File path: airflow/providers/amazon/aws/sensors/s3_key.py
##########
@@ -69,30 +69,33 @@ def __init__(
**kwargs,
):
super().__init__(**kwargs)
- # Parse
- if bucket_name is None:
- parsed_url = urlparse(bucket_key)
+
+ self.bucket_name = bucket_name
+ self.bucket_key = bucket_key
+ self.wildcard_match = wildcard_match
+ self.aws_conn_id = aws_conn_id
+ self.verify = verify
+ self.hook: Optional[S3Hook] = None
+
+ def poke(self, context):
+
+ if self.bucket_name is None:
+ parsed_url = urlparse(self.bucket_key)
if parsed_url.netloc == '':
- raise AirflowException('Please provide a bucket_name')
- else:
- bucket_name = parsed_url.netloc
- bucket_key = parsed_url.path.lstrip('/')
+ raise AirflowException(
+ 'If key is a relative path from root,' + ' please provide
a bucket_name'
Review comment:
```suggestion
'If key is a relative path from root, please provide a
bucket_name'
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]