Skip to content

UI: Fix Graph layout for TaskGroup tasks wired to external nodes#67720

Merged
pierrejeambrun merged 1 commit into
mainfrom
fix-graph-taskgroup-internal-edges-dropped
Jun 1, 2026
Merged

UI: Fix Graph layout for TaskGroup tasks wired to external nodes#67720
pierrejeambrun merged 1 commit into
mainfrom
fix-graph-taskgroup-internal-edges-dropped

Conversation

@vatsrahul1001

@vatsrahul1001 vatsrahul1001 commented May 29, 2026

Copy link
Copy Markdown
Contributor

Closes #67714.

#65031 could be cause of it

Fix

  • Tighten hasUniformExternalConnectivity to require every externally-connected child to share the same full (sources, targets) profile. Mixed entry/exit shapes (like the reporter's repro) now fall back to rendering individual crossing edges, preserving the author's explicit dependency intent. The canonical "cleanup group" fan-in/fan-out pattern that the optimization was designed for (every child has same upstream AND same downstream) still triggers the collapse.
  • Add a preserveInternal option to rewriteGroupEdges. The open-group call site sets it so the collapse optimization preserves internal edges for the subsequent extraction loop; the closed-group call site keeps the default (drop internals — they're not laid out when the group is collapsed).

Tests

New elkGraphUtils.test.ts covers:

Verified the new tests fail against main without the fix and pass with it.

Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.7)

Generated-by: Claude Code (Opus 4.7) following the guidelines

Open ``@task_group`` rendered with vertically-stacked internals and edges
crossing the boundary whenever an internal task had a direct dependency
on a node outside the group (an "escape edge" that bypassed the group's
entry/exit interface). Dag execution was unaffected.

Two underlying issues, both in the ELK graph-layout refactor from #65031:

1. ``hasUniformExternalConnectivity`` was too lenient — it fired whenever
   externally-connected children separately shared the same external
   sources OR the same external targets, instead of the canonical
   fan-in/fan-out pattern where every child has the same full
   ``(sources, targets)`` profile. On mixed-profile groups (entry +
   exits), it incorrectly fired and collapsed the author's deliberately-
   wired escape edges into a single group-level edge, hiding the intent.

2. When the optimisation did fire on an open group, ``rewriteGroupEdges``
   was tuned for closed groups and dropped the group's internal edges
   too, leaving ELK with no internal-layout information for the children
   (the visible symptom in #67714).

Fix: tighten ``hasUniformExternalConnectivity`` to require the full
profile to match across externally-connected children, and add a
``preserveInternal`` option to ``rewriteGroupEdges`` so the canonical
fan-in/fan-out path keeps internals intact.

Closes: #67714
@vatsrahul1001

Copy link
Copy Markdown
Contributor Author

cc: @pierrejeambrun @bbovenzi

@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.

Tested locally looks good. Code looks good.

@pierrejeambrun pierrejeambrun added this to the Airflow 3.2.3 milestone Jun 1, 2026
@pierrejeambrun pierrejeambrun merged commit 55780f2 into main Jun 1, 2026
83 checks passed
@pierrejeambrun pierrejeambrun deleted the fix-graph-taskgroup-internal-edges-dropped branch June 1, 2026 09:50
@github-actions

github-actions Bot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Backport successfully created: v3-2-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-2-test PR Link

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jun 1, 2026
…l nodes (apache#67720)

Open ``@task_group`` rendered with vertically-stacked internals and edges
crossing the boundary whenever an internal task had a direct dependency
on a node outside the group (an "escape edge" that bypassed the group's
entry/exit interface). Dag execution was unaffected.

Two underlying issues, both in the ELK graph-layout refactor from apache#65031:

1. ``hasUniformExternalConnectivity`` was too lenient — it fired whenever
   externally-connected children separately shared the same external
   sources OR the same external targets, instead of the canonical
   fan-in/fan-out pattern where every child has the same full
   ``(sources, targets)`` profile. On mixed-profile groups (entry +
   exits), it incorrectly fired and collapsed the author's deliberately-
   wired escape edges into a single group-level edge, hiding the intent.

2. When the optimisation did fire on an open group, ``rewriteGroupEdges``
   was tuned for closed groups and dropped the group's internal edges
   too, leaving ELK with no internal-layout information for the children
   (the visible symptom in apache#67714).

Fix: tighten ``hasUniformExternalConnectivity`` to require the full
profile to match across externally-connected children, and add a
``preserveInternal`` option to ``rewriteGroupEdges`` so the canonical
fan-in/fan-out path keeps internals intact.
(cherry picked from commit 55780f2)

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Closes: apache#67714
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Jun 1, 2026
…l nodes (apache#67720)

Open ``@task_group`` rendered with vertically-stacked internals and edges
crossing the boundary whenever an internal task had a direct dependency
on a node outside the group (an "escape edge" that bypassed the group's
entry/exit interface). Dag execution was unaffected.

Two underlying issues, both in the ELK graph-layout refactor from apache#65031:

1. ``hasUniformExternalConnectivity`` was too lenient — it fired whenever
   externally-connected children separately shared the same external
   sources OR the same external targets, instead of the canonical
   fan-in/fan-out pattern where every child has the same full
   ``(sources, targets)`` profile. On mixed-profile groups (entry +
   exits), it incorrectly fired and collapsed the author's deliberately-
   wired escape edges into a single group-level edge, hiding the intent.

2. When the optimisation did fire on an open group, ``rewriteGroupEdges``
   was tuned for closed groups and dropped the group's internal edges
   too, leaving ELK with no internal-layout information for the children
   (the visible symptom in apache#67714).

Fix: tighten ``hasUniformExternalConnectivity`` to require the full
profile to match across externally-connected children, and add a
``preserveInternal`` option to ``rewriteGroupEdges`` so the canonical
fan-in/fan-out path keeps internals intact.
(cherry picked from commit 55780f2)

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Closes: apache#67714
pierrejeambrun pushed a commit that referenced this pull request Jun 1, 2026
…l nodes (#67720) (#67830)

Open ``@task_group`` rendered with vertically-stacked internals and edges
crossing the boundary whenever an internal task had a direct dependency
on a node outside the group (an "escape edge" that bypassed the group's
entry/exit interface). Dag execution was unaffected.

Two underlying issues, both in the ELK graph-layout refactor from #65031:

1. ``hasUniformExternalConnectivity`` was too lenient — it fired whenever
   externally-connected children separately shared the same external
   sources OR the same external targets, instead of the canonical
   fan-in/fan-out pattern where every child has the same full
   ``(sources, targets)`` profile. On mixed-profile groups (entry +
   exits), it incorrectly fired and collapsed the author's deliberately-
   wired escape edges into a single group-level edge, hiding the intent.

2. When the optimisation did fire on an open group, ``rewriteGroupEdges``
   was tuned for closed groups and dropped the group's internal edges
   too, leaving ELK with no internal-layout information for the children
   (the visible symptom in #67714).

Fix: tighten ``hasUniformExternalConnectivity`` to require the full
profile to match across externally-connected children, and add a
``preserveInternal`` option to ``rewriteGroupEdges`` so the canonical
fan-in/fan-out path keeps internals intact.
(cherry picked from commit 55780f2)


Closes: #67714

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:TaskGroup area:UI Related to UI/UX. For Frontend Developers. kind:bug This is a clearly a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3.2.2 Graph View breaks when TaskGroup outputs connect internal tasks to external downstream tasks

2 participants