o-nikolas commented on code in PR #26886:
URL: https://github.com/apache/airflow/pull/26886#discussion_r989156545


##########
airflow/providers/amazon/aws/hooks/s3.py:
##########
@@ -902,14 +911,21 @@ def download_file(self, key: str, bucket_name: str | None 
= None, local_path: st
             else:
                 raise e
 
-        with NamedTemporaryFile(dir=local_path, prefix='airflow_tmp_', 
delete=False) as local_tmp_file:
+        if preserve_file_name:
+            local_dir = local_path if local_path else gettempdir()

Review Comment:
   As far as I understand this feedback, this is a further optimization. Since 
I don't think this new code causes either of the above issues mentioned since 
tempdir was ultimately called in the old path as well (if you don't provide a 
local_path of course). So there is no regression here.



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