You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pierrejeambrun (via GitHub)" <gi...@apache.org> on 2026/08/27 09:02:21 UTC

[PR] Fix hierarchical_alphabetical sort order breaking the graph and grid [airflow]

pierrejeambrun opened a new pull request, #72137:
URL: https://github.com/apache/airflow/pull/72137

   Sorting of tasks and nested TaskGroups in the graph/grid is governed by `[api] grid_view_sorting_order` (`topological` | `hierarchical_alphabetical`), applied recursively by the UI service on the **serialized** task group. But 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'
   ```
   
   i.e. the config value that gives *exactly* the alphabetical ordering of nested groups/tasks requested in #72114 doesn't sort — it `500`s 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`). The UI service already recurses into nested groups and re-applies the sorter per level, so nested TaskGroups are ordered too.
   
   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?
   
   - [X] Yes — Claude Code (Opus 4.8)
   
   Generated-by: Claude Code (Opus 4.8) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix hierarchical_alphabetical sort order breaking the graph and grid [airflow]

Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 merged PR #72137:
URL: https://github.com/apache/airflow/pull/72137


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix hierarchical_alphabetical sort order breaking the graph and grid [airflow]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #72137:
URL: https://github.com/apache/airflow/pull/72137#issuecomment-5568381428

   ### Backport successfully created: v3-3-test
   
   Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
   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](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
   
   <table>
           <tr>
           <th>Status</th>
           <th>Branch</th>
           <th>Result</th>
       </tr>
       <tr>
           <td>✅</td>
           <td>v3-3-test</td>
           <td><a href="https://github.com/apache/airflow/pull/72618"><img src="https://img.shields.io/badge/PR-72618-blue" alt="PR Link"></a></td>
       </tr>
   </table>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix hierarchical_alphabetical sort order breaking the graph and grid [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #72137:
URL: https://github.com/apache/airflow/pull/72137#issuecomment-5441937428

   <img width="1329" height="860" alt="Image" src="https://github.com/user-attachments/assets/790c298b-9531-469f-b0ae-421b3bcfe2d4" />


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix hierarchical_alphabetical sort order breaking the graph and grid [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun commented on PR #72137:
URL: https://github.com/apache/airflow/pull/72137#issuecomment-5442156681

   <img width="1921" height="924" alt="Screenshot 2026-08-27 at 18 32 19" src="https://github.com/user-attachments/assets/ba5ba391-7f1d-44a7-bca5-10aecb029dd0" />
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org