Repository navigation
TS SDK: generate Dag and task options from the serialization schema - #73436
Merged
jason810496 merged 1 commit intoSep 24, 2026
Merged
Conversation
This was referenced Sep 21, 2026
jason810496
force-pushed
the
feature/ts-sdk/dag-schema-codegen
branch
3 times, most recently
from
September 22, 2026 11:42
23efbb2 to
ef69d82
Compare
jason810496
force-pushed
the
feature/ts-sdk/dag-schema-codegen
branch
from
September 22, 2026 13:10
ef69d82 to
436dbdc
Compare
jason810496
marked this pull request as ready for review
September 22, 2026 13:14
jason810496
force-pushed
the
feature/ts-sdk/dag-schema-codegen
branch
from
September 23, 2026 02:45
436dbdc to
69dde3f
Compare
pierrejeambrun
approved these changes
Sep 23, 2026
pierrejeambrun
left a comment
Member
There was a problem hiding this comment.
LGTM, just a couple of thing worth addressing.
A Dag authored in TypeScript has to describe itself with the same options Airflow's scheduler reads, and that vocabulary lives in airflow-core's Dag serialization schema. Hand-listing those options in the SDK would leave two copies to keep aligned by hand, and the copy the SDK ships would quietly rot every time core adds, renames, or drops a key. Deriving them instead makes the drift visible: a new scalar key shows up in the regenerated diff or fails generation until someone says why the SDK omits it, and a curated entry that outlives the key it names fails the same way. The serialization version is the one thing the schema cannot supply, so a core bump now fails a test in airflow-core rather than producing Dags stamped with a version core no longer writes. This follows the policy the Go SDK's TaskSpec generator set and ADR-0008 records, so the three language SDKs expose the same Dag surface for the same documented reasons.
jason810496
force-pushed
the
feature/ts-sdk/dag-schema-codegen
branch
from
September 24, 2026 04:07
69dde3f to
006e05e
Compare
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mainon its own.Why
A native Dag has to express what Python would otherwise own: the schedule, and each task's options. Both already have a source of truth — Airflow's own Dag serialization schema — so the types are generated from it rather than hand-written, as
src/generated/supervisor.tsis.How
ts-sdk/schema/dag-schema.jsonis a vendored copy ofairflow-core/src/airflow/serialization/schema.json, kept honest by a prek hook, so a published npm package builds without the monorepo.scripts/generate-dag-schema.mjsemitsGeneratedDagFields/GeneratedTaskFieldsplus the table the serializer reads. Task fields are derived; Dag fields come from a curated allowlist, because thedagdefinition mixes authoring options with bundle bookkeeping.TaskOptions.argBindingsreplacesargNames, matching thearg_bindingsit fills in the serialized Dag and leavingwithArgNamesthe onlyargNamesin the SDK.Was generative AI tooling used to co-author this PR?