kartik00052 opened a new pull request, #73389: URL: https://github.com/apache/airflow/pull/73389
SFTP modification times were formatted in the process-local timezone and returned as a naive `%Y%m%d%H%M%S` string with the offset discarded. Consumers then interpreted that string using Airflow's configured timezone (`core.default_timezone`). Since `st_mtime` is an epoch timestamp, this made `newer_than` decisions depend on whether the process timezone matched `core.default_timezone` — and produce the wrong result when they differ. Changes: * `SFTPHook.get_mod_time` and `SFTPHookAsync.get_mod_time` now format the modification time in UTC. * `SFTPSensor` interprets the returned timestamp as UTC. * `SFTPTrigger` compares modification times as UTC for both the file-pattern and single-file paths. Regression tests cover mismatched process/default timezone configurations (UTC and `America/New_York`), including the equality boundary. They fail against the pre-fix implementation (3 failures) and pass with the fix (57 sensor/trigger tests pass on Linux). Note: `get_mod_time()` now returns a UTC string instead of a local-time string — code that parses this value itself should treat it as UTC. Documented in `providers/sftp/docs/changelog.rst`. This supersedes #73386, generalizing its trigger-only fix to the hook, the sensor, and both trigger paths. closes: #73382 --- ##### Was generative AI tooling used to co-author this PR? * [x] Yes (please specify the tool below) Generated-by: Claude Code 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]
