uranusjr commented on a change in pull request #16508:
URL: https://github.com/apache/airflow/pull/16508#discussion_r670205197
##########
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:
I’m still not following so please bear with me…
> However, what is happening is, the newly added subdag is created in off
state because is_paused_upon_creation by default is False.
If the default is False (i.e. not paused), why is the subdag created in the
off state?
The default `dags_are_paused_at_creation` value is actually True, so by
default, dags are created in in the paused state. So when the parent DAG is
unpaused, the newly-created subdag would indeed be in a different state. Is
this what you’re trying to say? (but not describing the true/false on/off
values correctly… which is understandable, the various negative value names are
difficult to keep straight)
----
Assuming that’s the case, setting a subdag to unpaused by default if the
parent dag is unpaused does sound like a reasonable thing to do, and the patch
is also right (from what I can tell). But that would arguably be a backward
incompatibility behavioural change I’m not sure we should just do. I hope
another maintainer can provide second opinion on this.
--
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]