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/02/19 09:52:40 UTC

[GitHub] [airflow] ashb commented on issue #7441: [AIRFLOW-6822] AWS hooks should cache boto3 client

ashb commented on issue #7441: [AIRFLOW-6822] AWS hooks should cache boto3 client
URL: https://github.com/apache/airflow/pull/7441#issuecomment-588131525
 
 
   To duplicate my comments from the Jira issue. I feel we could do this nicer with a lot less duplication:
   
   In AwsHook:
   ```
   from cached_property import cached_property
   
       @cached_property
       def conn(self):
           return self.get_client_type(self.client_type)
   
       def get_conn(self):
           # Compat shim
           return self.conn
   ```
   
   And then in each subclass we only need to define:
   
   ```
   class S3Hook(AwsHook):
       client_type = "S3"
   ```
   
   for instance.

----------------------------------------------------------------
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


With regards,
Apache Git Services