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 2020/11/18 19:26:55 UTC
[GitHub] [airflow] dsynkov commented on a change in pull request #12389: [AIRFLOW-5115] Bugfix for S3KeySensor failing to accept template_fields
dsynkov commented on a change in pull request #12389:
URL: https://github.com/apache/airflow/pull/12389#discussion_r526361395
##########
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:
Thanks; added!
----------------------------------------------------------------
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:
users@infra.apache.org