Skip to content

Fix hierarchical_alphabetical sort order breaking the graph and grid - #72137

Merged
vatsrahul1001 merged 1 commit into
apache:mainfrom
astronomer:fix-hierarchical-alphabetical-grid-sort
Sep 7, 2026
Merged

vatsrahul1001 merged 1 commit into
apache:mainfrom
astronomer:fix-hierarchical-alphabetical-grid-sort

Conversation

@pierrejeambrun

@pierrejeambrun pierrejeambrun commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

Only topological_sort was ported to SerializedTaskGroup — hierarchical_alphabetical_sort exists solely on the task-SDK TaskGroup. So selecting hierarchical_alphabetical calls a method that doesn't exist on the class the UI renders:

AttributeError: 'SerializedTaskGroup' object has no attribute 'hierarchical_alphabetical_sort'

500s the whole graph/grid.

Fix

Implement hierarchical_alphabetical_sort on SerializedTaskGroup, mirroring the task-SDK version (groups first, then tasks, each alphabetical by node_id).

With this, [api] grid_view_sorting_order = hierarchical_alphabetical orders tasks and nested TaskGroups alphabetically in both the graph and grid.

Reproduced

On main, hasattr(SerializedTaskGroup, "hierarchical_alphabetical_sort") is False; calling the UI getter under that config raises the AttributeError above. The added test fails without the fix (same AttributeError) and asserts the alphabetical order with it.

closes: #72114


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

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

The serialized task group the UI renders only re-implemented the topological sort order, so selecting [api] grid_view_sorting_order = hierarchical_alphabetical called a method that does not exist on it and raised AttributeError, failing the whole graph/grid render instead of ordering groups and tasks alphabetically.
@pierrejeambrun
pierrejeambrun force-pushed the fix-hierarchical-alphabetical-grid-sort branch from e2981b3 to 25d6863 Compare August 27, 2026 10:23
@pierrejeambrun pierrejeambrun added this to the Airflow 3.3.2 milestone Aug 27, 2026
@pierrejeambrun

Copy link
Copy Markdown
Member Author
Image

@pierrejeambrun
pierrejeambrun marked this pull request as ready for review August 27, 2026 16:14
@pierrejeambrun

Copy link
Copy Markdown
Member Author
Screenshot 2026-08-27 at 18 32 19

@vatsrahul1001 vatsrahul1001 added the type:bug-fix Changelog: Bug Fixes label Sep 7, 2026
@vatsrahul1001
vatsrahul1001 merged commit adaaf3a into apache:main Sep 7, 2026
304 checks passed
@vatsrahul1001
vatsrahul1001 deleted the fix-hierarchical-alphabetical-grid-sort branch September 7, 2026 09:17
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

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

github-actions Bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Sep 7, 2026
…ph and grid (apache#72137)

The serialized task group the UI renders only re-implemented the topological sort order, so selecting [api] grid_view_sorting_order = hierarchical_alphabetical called a method that does not exist on it and raised AttributeError, failing the whole graph/grid render instead of ordering groups and tasks alphabetically.
(cherry picked from commit adaaf3a)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
aws-airflow-bot pushed a commit to aws-mwaa/upstream-to-airflow that referenced this pull request Sep 7, 2026
…ph and grid (apache#72137)

The serialized task group the UI renders only re-implemented the topological sort order, so selecting [api] grid_view_sorting_order = hierarchical_alphabetical called a method that does not exist on it and raised AttributeError, failing the whole graph/grid render instead of ordering groups and tasks alphabetically.
(cherry picked from commit adaaf3a)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
vatsrahul1001 pushed a commit that referenced this pull request Sep 8, 2026
…ph and grid (#72137) (#72618)

The serialized task group the UI renders only re-implemented the topological sort order, so selecting [api] grid_view_sorting_order = hierarchical_alphabetical called a method that does not exist on it and raised AttributeError, failing the whole graph/grid render instead of ordering groups and tasks alphabetically.
(cherry picked from commit adaaf3a)

Co-authored-by: Pierre Jeambrun <pierrejbrun@gmail.com>
pierrejeambrun added a commit to astronomer/airflow that referenced this pull request Sep 8, 2026
…pache#72137)

The serialized task group the UI renders only re-implemented the topological sort order, so selecting [api] grid_view_sorting_order = hierarchical_alphabetical called a method that does not exist on it and raised AttributeError, failing the whole graph/grid render instead of ordering groups and tasks alphabetically.
imrichardwu pushed a commit to imrichardwu/airflow that referenced this pull request Sep 11, 2026
…pache#72137)

The serialized task group the UI renders only re-implemented the topological sort order, so selecting [api] grid_view_sorting_order = hierarchical_alphabetical called a method that does not exist on it and raised AttributeError, failing the whole graph/grid render instead of ordering groups and tasks alphabetically.
regarmukesh3g pushed a commit to regarmukesh3g/airflow that referenced this pull request Sep 27, 2026
…pache#72137)

The serialized task group the UI renders only re-implemented the topological sort order, so selecting [api] grid_view_sorting_order = hierarchical_alphabetical called a method that does not exist on it and raised AttributeError, failing the whole graph/grid render instead of ordering groups and tasks alphabetically.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError sort order hierarchical_alphabetical

2 participants