dstandish opened a new pull request, #36456: URL: https://github.com/apache/airflow/pull/36456
When arrowing `group` >> `task`, the "leaves" of `group` are connected to `task`. When calculating leaves in the group, teardown tasks are ignored, and we recurse upstream to find non-teardowns. What was happening, and what this fixes, is you might recurse to a work task that already has another non-teardown downstream in the group. In that case you should ignore the work task (because it already has a non-teardown descendent). ### Before: ![image](https://github.com/apache/airflow/assets/15932138/15da394b-c619-4dc6-a430-847dbfb2781f) ### After: ![image](https://github.com/apache/airflow/assets/15932138/7d7021f6-bc27-4063-8598-95f94b005322) Code: ```python with DAG(dag_id="s_t_dag") as dag: @task def test_task(): print("Hello world!") @task_group def inner(): inner_start = EmptyOperator(task_id="start") inner_end = EmptyOperator(task_id="end") test_task_r = test_task.override(task_id="work")() inner_start >> test_task_r >> inner_end.as_teardown(setups=inner_start) @task_group def outer(): outer_work = EmptyOperator(task_id="work") inner_group = inner() inner_group >> outer_work dag_start = EmptyOperator(task_id="dag_start") dag_end = EmptyOperator(task_id="dag_end") dag_start >> outer() >> dag_end ``` -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org