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/07/15 05:29:18 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #16508: Fixes #16507 Subdags are now created with pause status based on their parent.

uranusjr commented on a change in pull request #16508:
URL: https://github.com/apache/airflow/pull/16508#discussion_r670144247



##########
File path: airflow/models/dag.py
##########
@@ -1847,7 +1847,10 @@ def bulk_write_to_db(cls, dags: Collection["DAG"], session=None):
         for missing_dag_id in missing_dag_ids:
             orm_dag = DagModel(dag_id=missing_dag_id)
             dag = dag_by_ids[missing_dag_id]
-            if dag.is_paused_upon_creation is not None:
+
+            if dag.is_subdag:
+                orm_dag.is_paused = dag.parent_dag.get_is_paused()
+            elif dag.is_paused_upon_creation is not None:

Review comment:
       > setting is_paused_upon_creation there will impact existing subdags as well (don't think that will negatively impact but still).
   
   I’m definitely missing something, because I thought this is what this PR is for? When a parent DAG is set to pause, its subdags should also be paused?




-- 
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-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org