Skip to content

TS SDK: Add conditional branching with dag.if - #74069

Merged
jason810496 merged 1 commit into
apache:mainfrom
guan404ming:ts-sdk-dag-if
Oct 7, 2026
Merged

jason810496 merged 1 commit into
apache:mainfrom
guan404ming:ts-sdk-dag-if

Conversation

@guan404ming

@guan404ming guan404ming commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Related

Why

How

  • Add dag.if(fn, inputs?, spec?).then(a).else(b), taking a trailing TaskSpec as Go's dag.If does.
  • Skip the branch not taken, and keep it skipped when it is cleared.
  • Make a condition an edge endpoint, so task.after(gate) works as in Go.

Was generative AI tooling used to co-author this PR?

@guan404ming guan404ming changed the title TS SDK: Add dag.if taking a handler, as Go does TS SDK: Add dag.if taking a handler Oct 2, 2026
@guan404ming
guan404ming force-pushed the ts-sdk-dag-if branch 3 times, most recently from e78c3f6 to 2f647ea Compare October 2, 2026 07:36
@guan404ming
guan404ming marked this pull request as ready for review October 2, 2026 07:38
@guan404ming
guan404ming force-pushed the ts-sdk-dag-if branch 2 times, most recently from f9be893 to 67ab684 Compare October 2, 2026 07:47
@guan404ming guan404ming changed the title TS SDK: Add dag.if taking a handler TS SDK: Add conditional branching with dag.if Oct 2, 2026

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks.

Comment thread airflow-core/docs/authoring-and-scheduling/language-sdks/typescript.rst Outdated

@jason810496 jason810496 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update.
No concern from me, and no finding from the claude review.

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks only one thing to address I believe.

Comment thread ts-sdk/adr/0002-native-dag-interface.md
Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
@jason810496
jason810496 merged commit 62917ea into apache:main Oct 7, 2026
91 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants