jens-scheffler-bosch commented on issue #32603:
URL: https://github.com/apache/airflow/issues/32603#issuecomment-1636877961

   I assume this is rather a modelling issue than a problem with a task mapping 
logic. In your example the `dummy_task` is defined outside the DAG context and 
can not be correctly associated. Try it to be defined within the DAG scope, 
then it works, for example below:
   
   ```
   from datetime import datetime
   
   from airflow.decorators import dag, task, task_group
   from airflow.operators.dummy_operator import DummyOperator
   
   @task()
   def print_task(data):
       print(data)
   
   @task_group()
   def tg(data):
       print_task(data)
   
   @dag(
       dag_id="issue_32603",
       schedule=None,
       catchup=False,
       start_date=datetime(2021, 1, 1),
       max_active_runs=1,
   )
   def ExpansionIssueDAG():
       dummy_task = DummyOperator(task_id="dummy_task")
       tg.expand(data=dummy_task.output)
   
   
   dag = ExpansionIssueDAG()
   ```
   
   Result is:
   
![Screenshot_2023-07-15_22-13-24](https://github.com/apache/airflow/assets/95105677/7d5037ed-1aea-4daf-9de0-d31231a4c309)
   


-- 
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]

Reply via email to