09Catho opened a new pull request, #69468:
URL: https://github.com/apache/airflow/pull/69468

   ## Summary
   
   - add an `overwrite_file` option to `ImapHook.download_mail_attachments`, 
defaulting to the existing overwrite behavior
   - preserve duplicate attachment filenames when `overwrite_file=False` by 
writing numeric suffixed copies such as `report_1.csv`
   - add focused regression coverage for overwrite and non-overwrite behavior, 
including filenames without extensions and filenames with multiple extensions
   
   Fixes #65870
   
   ## Tests
   
   - `python -m ruff check 
providers\imap\src\airflow\providers\imap\hooks\imap.py 
providers\imap\tests\unit\imap\hooks\test_imap.py`
   - `python -m ruff format --check 
providers\imap\src\airflow\providers\imap\hooks\imap.py 
providers\imap\tests\unit\imap\hooks\test_imap.py`
   - `git diff --check`
   - standalone collision regression script for `_create_file` preserving 
duplicate filenames and overwriting existing files
   
   I also attempted the focused pytest target with Airflow's managed 
environment:
   
   - `uv run python -m pytest providers\imap\tests\unit\imap\hooks\test_imap.py 
-q`
   
   That environment setup failed on Windows before running tests because 
`apache-airflow[all]` pulls `apache-airflow-core[memray]`, and `memray==1.19.3` 
reports `memray does not support this platform (win32)`.
   
   ## AI assistance
   
   This PR was prepared with AI assistance and reviewed by me before submission.


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