Repository navigation
Honor [scheduler] create_cron_data_intervals when serializing cron schedules in the Go SDK #67938
Description
Background
The Go bundle serializer always emits CronTriggerTimetable for a cron schedule, which only matches the default deployment ([scheduler] create_cron_data_intervals = False). When a deployment sets it to True, Python's _create_timetable (task-sdk/src/airflow/sdk/definitions/dag.py) produces CronDataIntervalTimetable instead, so a Go-authored DAG diverges from the equivalent Python DAG.
The Go bundle binary cannot read airflow.cfg, so it has no way to branch on the flag today. The relevant scheduler settings must be delivered from the supervisor (Python ExecutableCoordinator) to the lang-SDK over the coordinator protocol first.
Current hardcoded branch in go-sdk/pkg/execution/serde.go (serializeTimetable):
default:
return map[string]any{
"__type": "airflow.timetables.trigger.CronTriggerTimetable",
"__var": map[string]any{
"expression": *schedule,
"timezone": "UTC",
"interval": 0.0,
"run_immediately": false,
},
}What needs to happen
- Extend the coordinator protocol so the supervisor sends
create_cron_data_intervals(andcreate_delta_data_intervals, once timedelta schedules are supported) to the bundle — e.g. as fields onDagFileParseRequest. - In
serializeTimetable, emitCronDataIntervalTimetable({expression, timezone}) whencreate_cron_data_intervalsisTrueandCronTriggerTimetablewhenFalse, mirroring_create_timetable. - Carry the DAG timezone over the same channel;
serializeTimetablecurrently hardcodes"UTC".
Acceptance criteria
- A cron-scheduled Go DAG serializes to the same timetable
__typeand__varas the equivalent Python DAG under both values ofcreate_cron_data_intervals. - DAG timezone is no longer hardcoded to
"UTC". - The
TODOonserializeTimetableingo-sdk/pkg/execution/serde.gois removed.
Context
- Originating PR: Go-SDK: Dag/Task specs and downstream wiring in the authoring API #67155 (Go-SDK Dag/Task specs and downstream wiring in the authoring API) — serde parity review.
- Related: Cross-SDK DagSerialization compatibility CI for the Go SDK #66942 (Cross-SDK DagSerialization compatibility CI for the Go SDK) — a CI harness like that would catch this divergence automatically.
- Python reference:
_create_timetableintask-sdk/src/airflow/sdk/definitions/dag.py; config default inairflow-core/src/airflow/config_templates/config.yml(create_cron_data_intervals, defaultFalse).
Drafted-by: Claude Code (Opus 4.8); reviewed by @jason810496 before posting
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
Go-SDK: Match Python DagSerialization output in bundle serde
Go-SDK: Match Python DagSerialization output in bundle serde