Remove the leftover temporary report file in BidManager download (#67076)
GoogleBidManagerDownloadReportOperator downloads the report to a NamedTemporaryFile(delete=False) and never removes it after the GCS upload, leaving a copy of the unencrypted report on the worker disk for every execution. Wrap the download+upload in try/finally so the local temp file is deleted on both the success and failure path. The handle is closed before the unlink so the cleanup works on Windows too (NamedTemporaryFile keeps the handle open; unlink raises PermissionError while it is held). Unexpected OSErrors on cleanup are surfaced as a log.warning rather than silently swallowed, so antivirus/NFS edge cases remain observable; FileNotFoundError stays silent because a missing file is benign. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
L
Lokhesh Ujhoodha committed
a7174b5bc6dcffabeb8ab72e2256c7cfe9035a13
Parent: e55cffc
Committed by GitHub <noreply@github.com>
on 5/29/2026, 1:48:10 PM