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

   Since 3.3.1, the Grid and Graph views return HTTP 500 for Dags whose 
TaskGroups depend on each other when each group is treated as a single unit. 
The task graph itself is acyclic, and these Dags parse, schedule and run 
normally. #69933 made the group-level sort account for group-to-group and 
cross-group edges, so these group-level cycles now raise instead of rendering 
in an arbitrary order.
   
   Two shapes trigger it:
   
   - Sibling groups with task-level edges in both directions (`a1 >> b1` and 
`b2 >> a2` across `group1` and `group2`).
   - Two tasks in one group bridged by a task outside it (`a >> ext >> b`). A 
task with no upstream inside its own group counts as a root of that group, so 
`ext` and the group depend on each other.
   
   Filtering can also create the cycle in a Dag that has none. With 
`root=g.first&include_downstream=true`, `partial_subset()` can drop a task's 
only in-group upstream and turn it into a group root. So Grid and Graph need to 
tolerate group-level cycles whatever is decided about rejecting these Dags at 
parse time, which is being discussed in #73678.
   
   The serialized TaskGroup sort now orders the siblings on a cycle as one 
unit, placed where its first child is declared, with its members in declaration 
order. Everything around the cycle keeps the existing pass-numbering order, and 
Dags without a group-level cycle are unaffected. The Task SDK sort still 
raises, so it can still be used to detect these Dags at parse time.
   
   This replaces #72822 with a narrower change: it touches only the serialized 
side, drops the task-level cycle re-check (task-level cycles are already 
rejected at parse time), and leaves the shared `dagnode` library alone.
   
   related: #73678
   
   This should be backported to `v3-3-test`; 
`serialization/definitions/taskgroup.py` is identical there.
   
   #### Testing
   
   - New tests cover sibling groups, a group bridged by an outside task, and a 
three-group ring (which takes the pass-numbering path), plus the filtered case 
against the Structure and Grid endpoints. All five fail on `main` and pass with 
this change.
   - `airflow-core/tests/unit/serialization` and 
`airflow-core/tests/unit/api_fastapi/core_api/routes/ui`: 1599 passed, 1 
skipped (SQLite).
   - `prek` pre-commit and manual stages pass, including `mypy-airflow-core`.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to