You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/05/11 08:44:13 UTC

[GitHub] [airflow] dinigo commented on a change in pull request #12741: Adds Docs to compare SubDAGs and TaskGroups

dinigo commented on a change in pull request #12741:
URL: https://github.com/apache/airflow/pull/12741#discussion_r629970942



##########
File path: docs/apache-airflow/concepts.rst
##########
@@ -1022,6 +1023,28 @@ This animated gif shows the UI interactions. TaskGroups are expanded or collapse
 
 .. image:: img/task_group.gif
 
+While TaskGroups and SubDAGs are both used to create repeating patterns, depending on your use case, one may be better
+than the other. The SubDagOperator launches a DAG as a separate entity from the original graph. This design pattern
+offers flexibility to create SubDAGs with different schedulers and executors at the cost of greater complexity and
+maintenance burden. TaskGroups creates a UI grouping concept on the same original DAG which simplifies logic and
+maintenance for less flexibility.
+
+Here is a table that summarizes their differences:
++----------------------+----------------------+
+| Task Group           | SubDAG               |
++======================+======================+
+| Repeating patterns   |  Repeating patterns  |
+| live on the same DAG |  run as separate DAGs|
++----------------------+----------------------+
+| Follows schedule of  |  Creates a new       |
+| DAG                  |  schedule            |
++----------------------+----------------------+
+| Has same executor as |  Can specify an      |
+| DAG                  |  executor            |
++----------------------+----------------------+
+| Honors all pool      |  Does not honor pool |
+| configurations       |  configurations      |
++----------------------+----------------------+

Review comment:
       There are two parts here:
   * Parent DAG "SubDAG task" — This is the link between the two: the parent and the SubDAG. It is runs  a "Sensor" underneath. I think you can even specify the poking interval.
   * SubDAG "DAG" — Can be added to the `global` scope to make it available in the main screen, have different schedule intervals... just like a regular DAG. Only limitation is the name (AFAIK).
   
   SubDAG could easily be renamed as `ExternalDagSensor`




-- 
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:
users@infra.apache.org