yuqian90 opened a new pull request #12829: URL: https://github.com/apache/airflow/pull/12829
Closes #12757 When a task does not have a dag at the time it's being set as a relative of another task, the Graph View becomes empty. For example: ```python from airflow import DAG from airflow.operators.dummy_operator import DummyOperator from airflow.utils.dates import days_ago dag = DAG(dag_id='example_graph_view_issue', start_date=days_ago(2)) op1 = DummyOperator(task_id='op1', dag=dag) op2 = DummyOperator(task_id='op2') op1 >> op2 ``` Note op2 does not have a dag when `op1 >> op2` is called. It's added to op1's DAG after this line, but not added to any `TaskGroup`. This causes Graph View to break. This PR fixes the issue by adding `op2` to the root `TaskGroup` if op1's DAG when `op1 >> op2` is called. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
