uranusjr opened a new pull request #20671:
URL: https://github.com/apache/airflow/pull/20671


   Instead of always using the task returned by the task group function as the 
dependency representation, also allow a task group function to *not* return any 
task specifically.
   
   Setting dependency to such a group would depend on the group's contained 
tasks as a whole, and not any specific task in it.
   
   This renders this DAG definition taken from 
https://github.com/apache/airflow/issues/19903#issuecomment-1004105943 (which 
would fail to parse currently)
   
   ```python
   @dag(start_date=datetime(2023, 1, 1), schedule_interval="@once")
   def test_dag_1():
       @task
       def start():
           pass
   
       @task
       def do_thing(x):
           print(x)
   
       @task_group
       def do_all_things():
           do_thing(1)
           do_thing(2)
   
       @task
       def end():
           pass
   
       start() >> do_all_things() >> end()
   
   my_dag = test_dag_1()
   ```
   
   like this:
   
   
![image](https://user-images.githubusercontent.com/605277/148199155-c3e7fd20-e340-4003-88d0-ff3bea636cdd.png)
   
   Tests to come later.


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