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

   `ExternalTaskSensor` logs the external logical date only in UTC (`Poking for 
DAG 'x' on 2026-07-06T21:00:00+00:00 ...`). When `[core] default_timezone` is 
not UTC, that's hard to match against the UI and the other timestamps in the 
task log.
   
   The poke log now adds the date in the configured timezone after the UTC 
value. The suffix is left out when the two are the same:
   
   ```
   Poking for DAG 'other_dag' on 2026-07-06T21:00:00+00:00 (default timezone: 
2026-07-07T06:00:00+09:00) ...
   ```
   
   Only the log line changes. `external_dates_filter`, which listeners read, 
keeps the original serialized value.
   
   This carries forward #69666 by reachsrinivaschennupati-tech, which was 
stale-closed. They are credited with `Co-authored-by` on the commit. The review 
points from that PR are addressed:
   
   - No `airflow.settings` import. The timezone is read from 
`core.default_timezone` through the compat `conf`, and is resolved with 
`pendulum.timezone()` and `pendulum.local_timezone()`, both available in 
pendulum 2 and 3.
   - `"system"` uses `pendulum.local_timezone()`, as core does, so dates on the 
other side of a DST change get the right offset.
   - Formatting is guarded. If anything fails, for example an invalid zone 
name, the log falls back to the plain serialized value and the poke still 
succeeds. This matches core, which falls back to UTC.
   - The tests use `conf_vars` instead of patching `get_mandatory_value`. There 
is one parametrized test with these cases: UTC (no suffix), configured zone, 
`system`, and an invalid zone (the poke succeeds and the log falls back to the 
plain value).
   
   closes: #69657
   
   ### Testing
   
   All runs were local with `uv run --project providers/standard` (no Docker or 
Breeze available). Two environment workarounds were needed: `mysqlclient` was 
skipped because `pkg-config` and the MySQL headers are not on the host, and 
`shared/secrets_masker` was installed editable because the `cap_structlog` 
fixture imports it.
   
   - New test on `main` without the fix: 2 failed, 2 passed. 
`configured-timezone` and `system` fail because the log has no default-timezone 
rendering. `utc` and `invalid-timezone` pass.
   - With the fix: 4 passed.
   - `providers/standard/tests/unit/standard/sensors/test_external_task.py`: 81 
passed, 65 skipped (the Airflow 2-only classes).
   - `providers/standard/tests/unit/standard/triggers/test_external_task.py`: 
14 passed, 8 skipped.
   - `prek run --files <changed files>`: all applicable hooks pass. 
`check-template-fields-valid` was skipped because it needs Breeze. Provider 
mypy (`breeze run mypy`) was not run.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Opus 5.5) 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]

  • [PR] Show configured timezone ... Harp404 (via GitHub) via commits

Reply via email to