mifuha opened a new pull request, #73386: URL: https://github.com/apache/airflow/pull/73386
When `SFTPTrigger` uses `file_pattern` with `newer_than`, different process and Airflow timezones can make it choose the wrong files. A file modified at 12:00 UTC can incorrectly pass a 14:00 UTC threshold. Reversing the timezone settings can reject a file that is new enough. This fix reads the modification timestamp directly as UTC. It keeps the existing inclusive comparison and whole-second precision. The regression tests run the real trigger in fresh processes with different timezone settings and mocked SFTP calls. They cover both wrong decisions, UTC controls, equal timestamps, a non-hour timezone offset, fractional seconds and missing modification times. Related: #73382. The single-file trigger and synchronous sensor paths still use the existing string-based hook methods and remain affected. This PR leaves those interfaces unchanged, so the issue should stay open. Checks run with locked dependencies: - Both mismatch cases failed before the fix; the UTC controls passed. - All 55 focused SFTP tests passed after the fix on Python 3.12.3. - All 11 timezone regression cases passed on Python 3.10.21 and 3.12.3. - The regular pre-commit checks and commit-message check passed. - `git diff --check` passed. The manual provider check could not finish because the local environment reported bus and I/O errors while Docker was exporting its CI image. The full provider suite, live SFTP tests and compatibility matrix were not run locally. — @mifuha --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Codex (GPT-6) Generated-by: Codex (GPT-6) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions). I used Codex to help investigate the issue, write the fix and tests, and prepare this PR. -- 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]
