Add overwrite parameter to IMAP hook download_mail_attachments#66850
Add overwrite parameter to IMAP hook download_mail_attachments#66850kyupark wants to merge 2 commits into
Conversation
|
@kyupark — There is 1 unresolved review thread on this PR from If yes, please mark the thread as resolved and ping the reviewer ( If you are still working on the thread, please reply with what is outstanding so the threads stay unresolved on purpose. Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you. Drafted-by: Claude Code (Opus 4.7); reviewed by @potiuk before posting |
|
@phanikumv I added the focused FileExistsError retry test you suggested: the first Local checks passed and CI is green. I’ve marked the thread resolved. Could you take a final look when you have a chance? |
Add an
overwriteparameter to the IMAP hook'sdownload_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?
Generated-by: Claude Code (Opus 4.7) following the guidelines