dheerajturaga opened a new pull request, #73746: URL: https://github.com/apache/airflow/pull/73746
Dags whose TaskGroups depend on each other in a cycle, when each group is treated as a single unit, parse and run today even though planned TaskGroup features need an unambiguous order between groups. Following the dev list discussion, this deprecates them: they keep working, users are warned now, and Airflow 3.5 is planned to reject them at parse time. This replaces the immediate parse-time rejection proposed in #73087. A task with no upstream inside its own TaskGroup counts as a root of that group, even when a task outside the group is its upstream. So these cycles show up in Dags that look ordinary, for example `a >> bridge >> b` with `a` and `b` in the same group and `bridge` outside it. Parsing a Dag with such a cycle now: - issues a `TaskGroupCycleDeprecationWarning` from `DAG.check_cycle()`, so CI can catch it, for example with `pytest -W error::airflow.sdk.exceptions.TaskGroupCycleDeprecationWarning`; - records a new `task group cycle` Dag warning, shown in the UI's Dag warnings and returned by `GET /api/v2/dagWarnings`. The message names only the tasks and TaskGroups on the cycle: > Dag 'etl': group1 and group2 depend on each other in a cycle. Cyclic TaskGroup dependencies are deprecated and will fail Dag parsing in Airflow 3.5. See "Cyclic TaskGroup dependencies" in the docs. A new "Cyclic TaskGroup dependencies" section in the Dags docs covers the Dag shapes that trigger this, how to fix them, and how to catch them in CI. Python ignores `DeprecationWarning` by default outside `__main__`, so the Dag processor enables this category while it records the warning for the UI, and still re-issues it to the caller's own warning filters. The Grid/Graph HTTP 500 for these Dags is fixed separately in #73724. The parse-time rejection in 3.5 is tracked in #73678. related: #73678 Discussion: https://lists.apache.org/thread/sossl7b2w2ftyk4028qrhps2tcdxj2px --- ##### 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]
