jason810496 opened a new pull request, #73530: URL: https://github.com/apache/airflow/pull/73530
# Take a task reference for If and Switch in ADR-0008 - Docs only: no code changes. Independent of the native TypeScript Dag stack, #73435 to #73446, which implements this shape. ## Why `airflow-core/adr/lang-sdk/0008-control-flow-constructs.md` decision 2 already has a *case* be the task reference the SDK handed back rather than a label, so the compiler checks the candidate exists and no name has to be kept in step with it. The condition it selects on was still a callable plus a task id. That leaves a branch depending on a task's id or its function name — the thing decision 2 set out to avoid — and it is the one part of the construct each SDK spelled differently. ## What changes - `If` and `Switch` take the reference of an already-declared task, so the condition is declared, named and typed the way every other task is. An SDK whose `TaskRef` carries the handler's return type can then require a boolean for `If` and a ref for `Switch`, which a callable passed straight to `If` cannot express. - The trigger task is spelled `dag.TriggerDagRun(spec)`, since the Dag is what it belongs to and it wraps no function of the author's. - Records that the deciding task is serialized as a skipmixin operator and writes the `skipmixin_key` XCom alongside the skip, so clearing a skipped branch re-skips it rather than running the side the decision rejected — what `SkipMixin` already does for a Python branch. The Go example is updated to match. Nothing about the decisions changes beyond the two spellings above. --- ##### Was generative AI tooling used to co-author this PR? - [x] Yes, with help of Claude Code Opus 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]
