alexkruc commented on code in PR #26886:
URL: https://github.com/apache/airflow/pull/26886#discussion_r992056925


##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -879,17 +880,38 @@ def delete_objects(self, bucket: str, keys: str | list) 
-> None:
 
     @provide_bucket_name
     @unify_bucket_name_and_key
-    def download_file(self, key: str, bucket_name: str | None = None, 
local_path: str | None = None) -> str:
+    def download_file(
+        self,
+        key: str,
+        bucket_name: str | None = None,
+        local_path: str | None = None,
+        preserve_file_name: bool = False,
+        use_autogenerated_subdir: bool = True,
+    ) -> str:
         """
         Downloads a file from the S3 location to the local file system.
 
         :param key: The key path in S3.
         :param bucket_name: The specific bucket to use.
         :param local_path: The local path to the downloaded file. If no path 
is provided it will use the
             system's temporary directory.
+        :param preserve_file_name: If you want the downloaded file name to be 
the same name as it is in S3,
+            set this parameter to True. When set to False, a random filename 
will be generated.
+            Default: False.
+        :param use_autogenerated_subdir: Pairs with 'preserve_file_name = 
True' to download the file into a
+            random generated folder inside the 'local_path', useful to avoid 
collisions between various tasks
+            that might download the same file name. Set it to 'False' if you 
don't want it, and you want a
+            predictable path.
+            Default: True.
         :return: the file name.
         :rtype: str
         """
+        self.log.info(

Review Comment:
   @Taragolis I've added a log message here to show that this function shadows 
boto's method, hope that's fine :) 



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to