feluelle commented on a change in pull request #7541: [AIRFLOW-6822] AWS hooks
should cache boto3 client
URL: https://github.com/apache/airflow/pull/7541#discussion_r385080404
##########
File path: airflow/providers/amazon/aws/sensors/athena.py
##########
@@ -57,13 +57,11 @@ def __init__(self,
super().__init__(*args, **kwargs)
self.aws_conn_id = aws_conn_id
self.query_execution_id = query_execution_id
- self.hook = None
self.sleep_time = sleep_time
self.max_retires = max_retires
+ self.hook = AWSAthenaHook(self.aws_conn_id, self.sleep_time)
Review comment:
Please don't initiate a Hook in an Operators `__init__`, because 1. the
`__init__` will be called more often / every time the scheduler reads the dag
file. 2. The Hook will also be initiated even if the Operator doesn't execute.
----------------------------------------------------------------
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]
With regards,
Apache Git Services