Skip to content

TS SDK: Add edge labels with label() - #74494

Merged
guan404ming merged 4 commits into
apache:mainfrom
guan404ming:ts-sdk-edge-label
Oct 19, 2026
Merged

guan404ming merged 4 commits into
apache:mainfrom
guan404ming:ts-sdk-edge-label

Conversation

@guan404ming

Copy link
Copy Markdown
Member

Related

Why

  • TypeScript Dags cannot label an edge, as Python's Label does.
  • The serializer always wrote edge_info: {}.

How

  • Add label(node, text) to wrap the endpoint passed to before or after.
  • Redrawing an edge labels it; a later label wins; a label on the receiver is dropped.
  • Serialize labels into edge_info, keying a group end by its join node.
  • Document it in the TypeScript SDK guide.

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

guan404ming and others added 3 commits October 17, 2026 13:22
- Throw when before() or after() is called on a label, instead of dropping it.
- Validate label() arguments and reject labels in then/else/case with a hint.
- Report a label from another SDK copy with the duplicate-copy hint.
- Omit the label key on unlabelled edges.
- Test a labelled group-as-upstream edge on an acyclic Dag.

Co-Authored-By: Claude <noreply@anthropic.com>
A label() passed as a task input drew no edge and failed later at
serialization, and an empty label replaced an earlier one on the edge.
A task or group could also take a group's join node ID, under which
edge labels at a group end are keyed. label is now in the API docs.

Co-Authored-By: Claude <noreply@anthropic.com>

@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 for filling up the feature gap.

@jason810496 jason810496 added the backport-to-v3-4-test Backport to v3-4-test label Oct 18, 2026
@guan404ming

Copy link
Copy Markdown
Member Author

Thanks!

@guan404ming
guan404ming merged commit 777bf9b into apache:main Oct 19, 2026
78 checks passed
@github-actions github-actions Bot added this to the Airflow 3.4.1 milestone Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi maintainer, this PR was merged without a milestone set.
We've automatically set the milestone to Airflow 3.4.1 based on: backport label targeting v3-4-test
If this milestone is not correct, please update it to the appropriate milestone.

This comment was generated by Milestone Tag Assistant.

@github-actions

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-4-test

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
✅ v3-4-test PR Link

@guan404ming
guan404ming deleted the ts-sdk-edge-label branch October 19, 2026 04:21
github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 19, 2026
* TS SDK: Add edge labels with label()

* TS SDK: Tighten label() misuse checks

- Throw when before() or after() is called on a label, instead of dropping it.
- Validate label() arguments and reject labels in then/else/case with a hint.
- Report a label from another SDK copy with the duplicate-copy hint.
- Omit the label key on unlabelled edges.
- Test a labelled group-as-upstream edge on an acyclic Dag.

Co-Authored-By: Claude <noreply@anthropic.com>

* Use US spelling of labeled in TS SDK docs

* TS SDK: Reject misplaced and empty labels, reserve group join IDs

A label() passed as a task input drew no edge and failed later at
serialization, and an empty label replaced an earlier one on the edge.
A task or group could also take a group's join node ID, under which
edge labels at a group end are keyed. label is now in the API docs.

Co-Authored-By: Claude <noreply@anthropic.com>

---------
(cherry picked from commit 777bf9b)

Co-authored-by: Guan-Ming Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: ZHE YOU LIU <zhu424.dev@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Oct 19, 2026
* TS SDK: Add edge labels with label()

* TS SDK: Tighten label() misuse checks

- Throw when before() or after() is called on a label, instead of dropping it.
- Validate label() arguments and reject labels in then/else/case with a hint.
- Report a label from another SDK copy with the duplicate-copy hint.
- Omit the label key on unlabelled edges.
- Test a labelled group-as-upstream edge on an acyclic Dag.

Co-Authored-By: Claude <noreply@anthropic.com>

* Use US spelling of labeled in TS SDK docs

* TS SDK: Reject misplaced and empty labels, reserve group join IDs

A label() passed as a task input drew no edge and failed later at
serialization, and an empty label replaced an earlier one on the edge.
A task or group could also take a group's join node ID, under which
edge labels at a group end are keyed. label is now in the API docs.

Co-Authored-By: Claude <noreply@anthropic.com>

---------
(cherry picked from commit 777bf9b)

Co-authored-by: Guan-Ming Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: ZHE YOU LIU <zhu424.dev@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 19, 2026
* TS SDK: Add edge labels with label()

* TS SDK: Tighten label() misuse checks

- Throw when before() or after() is called on a label, instead of dropping it.
- Validate label() arguments and reject labels in then/else/case with a hint.
- Report a label from another SDK copy with the duplicate-copy hint.
- Omit the label key on unlabelled edges.
- Test a labelled group-as-upstream edge on an acyclic Dag.



* Use US spelling of labeled in TS SDK docs

* TS SDK: Reject misplaced and empty labels, reserve group join IDs

A label() passed as a task input drew no edge and failed later at
serialization, and an empty label replaced an earlier one on the edge.
A task or group could also take a group's join node ID, under which
edge labels at a group end are keyed. label is now in the API docs.



---------
(cherry picked from commit 777bf9b)

Co-authored-by: Guan-Ming Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: ZHE YOU LIU <zhu424.dev@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
vatsrahul1001 pushed a commit that referenced this pull request Oct 20, 2026
* TS SDK: Add edge labels with label()

* TS SDK: Tighten label() misuse checks

- Throw when before() or after() is called on a label, instead of dropping it.
- Validate label() arguments and reject labels in then/else/case with a hint.
- Report a label from another SDK copy with the duplicate-copy hint.
- Omit the label key on unlabelled edges.
- Test a labelled group-as-upstream edge on an acyclic Dag.



* Use US spelling of labeled in TS SDK docs

* TS SDK: Reject misplaced and empty labels, reserve group join IDs

A label() passed as a task input drew no edge and failed later at
serialization, and an empty label replaced an earlier one on the edge.
A task or group could also take a group's join node ID, under which
edge labels at a group end are keyed. label is now in the API docs.



---------
(cherry picked from commit 777bf9b)

Co-authored-by: Guan-Ming Chiu <105915352+guan404ming@users.noreply.github.com>
Co-authored-by: ZHE YOU LIU <zhu424.dev@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants