o-nikolas commented on code in PR #26886:
URL: https://github.com/apache/airflow/pull/26886#discussion_r990818625
##########
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:
I do also like option 1, it solves many of the complexities you pointed out
(or at least bubbles them up to the user) and also allows the user to create a
path that is predictable, so this is probably my preference. But they should be
able to provide a full sub path within tmp so that they can organize files with
similar names to their preference.
Although, option 2 would be perfectly serviceable as well.
--
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]