dheerajturaga commented on code in PR #73746: URL: https://github.com/apache/airflow/pull/73746#discussion_r4210834603
########## airflow-core/newsfragments/73746.significant.rst: ########## @@ -0,0 +1,20 @@ +Deprecate cyclic TaskGroup dependencies + +A Dag whose TaskGroups depend on each other in a cycle, when each TaskGroup is treated as a single unit, +now issues a ``TaskGroupCycleDeprecationWarning`` at parse time and shows a Dag warning in the UI that +names the TaskGroups and tasks involved. These Dags still parse and run, because their task dependencies +are acyclic, but Airflow 3.5 is planned to reject them at parse time. + +A dependency into or out of any task in a TaskGroup counts as a dependency of the whole group, so a path +that leaves a TaskGroup and comes back into it is a cycle. For example, ``a >> bridge >> b``, with ``a`` +and ``b`` in the same TaskGroup and ``bridge`` outside it, makes the group depend on ``bridge`` and +``bridge`` depend on the group, even if ``a >> b`` is also set. + +**Migration:** + +- Move tasks between TaskGroups, or out of them, so that each group depends on the others in one direction + only. In the example above, move ``bridge`` into the group, or move ``b`` out of it. +- To catch these Dags in CI, run your Dag tests with + ``-W error::airflow.sdk.exceptions.TaskGroupCycleDeprecationWarning``. Review Comment: Done: the migration bullet now says the check runs when a Dag is added to a `DagBag`, so only tests that load Dags into a `DagBag` and assert no import errors catch it, and a test that only imports a Dag file does not. I tightened the same sentence in dags.rst. --- Drafted-by: Claude Code (Opus 5.5); reviewed by @dheerajturaga before posting -- 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]
