XD-DENG commented on a change in pull request #2488: [AIRFLOW-1342] enable 
S3Hook to use host from connection
URL: https://github.com/apache/incubator-airflow/pull/2488#discussion_r215482023
 
 

 ##########
 File path: airflow/hooks/S3_hook.py
 ##########
 @@ -105,7 +105,9 @@ def __init__(
         self._creds_in_conn = 'aws_secret_access_key' in self.extra_params
         self._creds_in_config_file = 's3_config_file' in self.extra_params
         self._default_to_boto = False
-        if 'host' in self.extra_params:
+        if self.s3_conn.host is not None:
+            self.s3_host = self.s3_conn.host
+        elif 'host' in self.extra_params:
 
 Review comment:
   I agree this is quite useful for S3 compatible services, for example IBM's 
COS (Cloud Object Storage, my team is using it).
   
   Currently we need to set value 'host' in `extra_params`, which is not 
documented clearly. I only figured this out after reading source code.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to