TheChyeahhh opened a new pull request, #67755: URL: https://github.com/apache/airflow/pull/67755
## Summary Adds an `overwrite_file` parameter to `ImapHook.download_mail_attachments` to give users control over whether existing files are overwritten when downloading attachments with identical filenames. ## Related issue(s) Closes #65870 ## Changes ### Hook (`imap.py`) - Added `overwrite_file: bool = True` parameter to `download_mail_attachments` - Propagated the parameter through `_create_files` and `_create_file` - When `overwrite_file=False` and the target file already exists, the file is skipped and a warning is logged (instead of silently overwriting) ### Tests (`test_imap.py`) Added 3 new test methods: - `test_download_mail_attachments_skips_existing_file_when_overwrite_false` — verifies existing files are skipped when `overwrite_file=False` - `test_download_mail_attachments_writes_when_file_not_exists_and_overwrite_false` — verifies new files are still written when `overwrite_file=False` - `test_download_mail_attachments_overwrites_existing_file_when_overwrite_true` — verifies existing files are overwritten when `overwrite_file=True` -- 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]
