Skip to content

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

Open
pierrejeambrun wants to merge 1 commit into
apache:mainfrom
astronomer:fix-hierarchical-alphabetical-grid-sort
Open

Fix hierarchical_alphabetical sort order breaking the graph and grid#72137
pierrejeambrun wants to merge 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 SerializedTaskGrouphierarchical_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 pierrejeambrun added the backport-to-v3-3-test Backport to v3-3-test label 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

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.

AttributeError sort order hierarchical_alphabetical

1 participant