dheerajturaga commented on code in PR #73746:
URL: https://github.com/apache/airflow/pull/73746#discussion_r4210897199
##########
airflow-core/docs/core-concepts/dags.rst:
##########
@@ -624,6 +624,59 @@ If you want to see a more advanced use of TaskGroup, you
can look at the ``examp
When using the ``@task_group`` decorator, the decorated-function's
docstring will be used as the TaskGroups tooltip in the UI except when a
``tooltip`` value is explicitly supplied.
+.. _concepts:taskgroup-cycles:
+
+Cyclic TaskGroup dependencies
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. deprecated:: 3.4.0
+ Dags with cyclic TaskGroup dependencies are planned to fail Dag parsing
from Airflow 3.5.
+
+When each TaskGroup is treated as a single unit, a TaskGroup and its siblings
must not depend on each other
+in a cycle. A dependency into or out of any task in a group counts as a
dependency of the whole group. This
+can make a group both upstream and downstream of a sibling, although no
task-level dependency forms a cycle:
+
+.. code-block:: python
+
+ with TaskGroup("group1"):
+ a1 = EmptyOperator(task_id="a1")
+ a2 = EmptyOperator(task_id="a2")
+
+ with TaskGroup("group2"):
+ b1 = EmptyOperator(task_id="b1")
+ b2 = EmptyOperator(task_id="b2")
+
+ a1 >> b1 # group2 depends on group1
+ b2 >> a2 # group1 depends on group2
+
+A path that leaves a TaskGroup and comes back into it also forms a cycle, even
when the tasks inside the
Review Comment:
Agreed, it is intended. dags.rst now has it as its own example, says a
TaskGroup that holds a setup and its teardown must also hold the tasks between
them, and gives the fix (move `work` into `cluster`). The SDK tests pin both
sides: `setup-teardown-around-outside-task` warns with "cluster and work", and
`setup-teardown-in-group` does not warn.
---
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]