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 2022/10/13 12:17:52 UTC

[GitHub] [airflow] ashb commented on a diff in pull request #27030: Remove explicit call of `dagbag.collect_dags` in `airflow dags reserialize`

ashb commented on code in PR #27030:
URL: https://github.com/apache/airflow/pull/27030#discussion_r994568455


##########
airflow/utils/db.py:
##########
@@ -831,8 +831,8 @@ def reserialize_dags(*, session: Session = NEW_SESSION) -> None:
     from airflow.models.serialized_dag import SerializedDagModel
 
     session.query(SerializedDagModel).delete(synchronize_session=False)
-    dagbag = DagBag()
-    dagbag.collect_dags(only_if_updated=False, safe_mode=False)
+    dagbag = DagBag(collect_dags=False)
+    dagbag.collect_dags(only_if_updated=False, safe_mode=conf.getboolean('core', 'DAG_DISCOVERY_SAFE_MODE'))

Review Comment:
   Simpler: don't pass it and use the default.
   ```suggestion
       dagbag.collect_dags(only_if_updated=False)
   ```



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