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/04/23 21:39:01 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #8441: [AIRFLOW-7111] Add generate_presigned_url method to S3Hook

kaxil commented on a change in pull request #8441:
URL: https://github.com/apache/airflow/pull/8441#discussion_r414141917



##########
File path: airflow/providers/amazon/aws/hooks/s3.py
##########
@@ -729,3 +729,32 @@ def download_file(
             s3_obj.download_fileobj(local_tmp_file)
 
         return local_tmp_file.name
+
+    def generate_presigned_url(self, client_method, params=None, expires_in=3600, http_method=None):
+        """
+            Generate a presigned url given a client, its method, and arguments
+
+            :param client_method: The client method to presign for.
+            :type client_method: str
+            :param params: The parameters normally passed to ClientMethod.
+            :type params: dict
+            :param expires_in: The number of seconds the presigned url is valid for.
+                By default it expires in an hour (3600 seconds).
+            :type expires_in: int
+            :param http_method: The http method to use on the generated url.
+                By default, the http method is whatever is used in the method's model.
+            :type http_method: str
+            :return: The presigned url.
+            :rtype: str
+            """

Review comment:
       ```suggestion
       def generate_presigned_url(self, client_method, params=None, expires_in=3600, http_method=None):
           """
           Generate a presigned url given a client, its method, and arguments
   
           :param client_method: The client method to presign for.
           :type client_method: str
           :param params: The parameters normally passed to ClientMethod.
           :type params: dict
           :param expires_in: The number of seconds the presigned url is valid for.
               By default it expires in an hour (3600 seconds).
           :type expires_in: int
           :param http_method: The http method to use on the generated url.
               By default, the http method is whatever is used in the method's model.
           :type http_method: str
           :return: The presigned url.
           :rtype: str
           """
   ```




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