Seraph-x opened a new pull request, #75492: URL: https://github.com/apache/airflow/pull/75492
A Go Dag serialized every cron expression as a `CronTriggerTimetable` and hardcoded `"UTC"` as the timetable timezone, so a Go Dag and the equivalent Python Dag did not agree on their schedule: - `[scheduler] create_cron_data_intervals` was ignored, so porting a cron Dag from the Python SDK to the Go SDK silently swapped data-interval scheduling for trigger-based scheduling. `data_interval_start` / `data_interval_end`, and every templated value derived from them, changed. - `start_date`'s timezone never reached the timetable, so a cron expression on a Dag with a non-UTC `start_date` fired at the wrong wall-clock time. The Dag processor now carries `[scheduler] create_cron_data_intervals` in the `DagFileParseRequest` it hands to the Lang-SDK runtime (`create_cron_data_intervals`, added as a `VersionChange` on the current supervisor schema), and the Go serializer uses it. `serializeTimetable` writes `CronDataIntervalTimetable` or `CronTriggerTimetable` the way `DAG._create_timetable` does, and both the Dag and its timetable get the timezone `DAG.timezone` / `encode_timezone` would produce for the same `start_date`: the IANA name for a named location, an integer offset for a fixed offset, `"UTC"` for UTC or no `start_date`. `go-sdk/airflow/spec.gen.go` documented the Dag timezone as "always UTC for a Go Dag"; that field doc and the generator now say the timezone comes from `StartDate`, which is what the code does. ##### Checks run locally - `cd go-sdk && go vet ./... && go test ./...`: passes, except `TestTriggerDagRunRejectsAnInvalidSpec`, which fails on `main` too because Go 1.27 changed the `encoding/json` max-depth error message. `TestSerializeConformanceDags` passes and the conformance fixture is unchanged with the default option. - `pytest airflow-core/tests/unit/dag_processing/test_lang_sdk_processor.py`: 46 passed, 2 skipped; the 4 errors are tests that read `/proc`, which macOS does not have. - `ruff check` and `ruff format --check` on the changed Python files, `gofmt -l` on `go-sdk`. - Schemas regenerated with `scripts/ci/prek/dump_supervisor_schemas.py` and `scripts/ci/prek/sync_go_sdk_schemas.py`; the generated models with `go generate ./pkg/execution/genmodels/...`. closes: #67938 ##### Was generative AI tooling used to co-author this PR? - [X] Yes (please specify the tool below) Generated-by: DeepSeek Harness agent 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]
