simon-hoon opened a new pull request, #71243:
URL: https://github.com/apache/airflow/pull/71243

   closes: #71234
   
   `CalendarService._calculate_cron_planned_runs()` handed `croniter` a 
UTC-tagged `start_time` when computing "planned" (future, not-yet-executed) 
calendar cells for cron-based timetables. `croniter` matches cron fields 
against whatever wall-clock its `start_time` carries, so for a Dag on a non-UTC 
`default_timezone`, planned runs came out shifted by the UTC offset (e.g. a 
`08:00 Asia/Seoul` schedule showed planned cells at `17:00`).
   
   This localizes `start_time` into the timetable's own timezone before 
constructing `croniter` (mirroring `CronMixin._get_next`), converting results 
back to UTC. Historical (already-executed) runs were unaffected, since those 
come straight from already-correct `DagRun` rows.
   
   Added a regression test for a non-UTC cron timetable in `test_calendar.py`.
   
   Verified with `uv sync --package apache-airflow-core` + pytest on 
`test_calendar.py`: 20/20 passing (19 existing + 1 new).
   
   Before/after (local demo, `schedule="0 8 * * *"`, 
`AIRFLOW__CORE__DEFAULT_TIMEZONE=Asia/Seoul`): planned cells moved from the 
16:00–17:00 row to the 08:00 row, now matching the Success row above.
   <img width="1080" height="700" alt="image" 
src="https://github.com/user-attachments/assets/a75e1808-d1e8-483f-a417-468c908d628a";
 />
   <img width="1080" height="700" alt="image" 
src="https://github.com/user-attachments/assets/5047557e-9ff9-4284-bb0e-119104415764";
 />
   
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (please specify the tool below)
   
   Generated-by: [Claude] following the guidelines
   
   ---
   
   * Read the **[Pull Request 
Guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-guidelines)**
 for more information. Note: commit author/co-author name and email in commits 
become permanently public when merged.
   * For fundamental code changes, an Airflow Improvement Proposal 
([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals))
 is needed.
   * When adding dependency, check compliance with the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   * For significant user-facing changes create newsfragment: 
`{pr_number}.significant.rst`, in 
[airflow-core/newsfragments](https://github.com/apache/airflow/tree/main/airflow-core/newsfragments).
 You can add this file in a follow-up commit after the PR is created so you 
know the PR number.


-- 
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]

Reply via email to