kyupark opened a new pull request, #66850:
URL: https://github.com/apache/airflow/pull/66850

   Add an `overwrite` parameter to the IMAP hook's 
`download_mail_attachments()` method.
   
   When `overwrite=True` (default), duplicate filenames are overwritten 
(current behavior).  
   When `overwrite=False`, unique filenames are generated by appending a suffix 
(e.g. `report_1.csv`, `report_2.csv`).
   
   The non-overwrite path uses exclusive create mode (`"xb"`) to avoid TOCTOU 
races, and checks both in-memory state and the filesystem to handle files left 
over from previous runs.
   
   closes: #65870
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 4.7)
   
   Generated-by: Claude Code (Opus 4.7) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


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