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 2020/03/10 11:26:18 UTC

[GitHub] [airflow] nuclearpinguin commented on a change in pull request #7674: [AIRFLOW-7022] Simplify DagFileProcessor.process_file method

nuclearpinguin commented on a change in pull request #7674: [AIRFLOW-7022] Simplify DagFileProcessor.process_file method
URL: https://github.com/apache/airflow/pull/7674#discussion_r390246266
 
 

 ##########
 File path: airflow/jobs/scheduler_job.py
 ##########
 @@ -852,16 +847,16 @@ def process_file(
 
         paused_dag_ids = DagModel.get_paused_dag_ids(dag_ids=dagbag.dag_ids)
 
+        active_dags = [dag for dag_id, dag in dagbag.dags.items() if dag_id not in paused_dag_ids]
+
         # Pickle the DAGs (if necessary) and put them into a SimpleDag
-        for dag_id, dag in dagbag.dags.items():
-            # Only return DAGs that are not paused
-            if dag_id not in paused_dag_ids:
-                pickle_id = None
-                if pickle_dags:
-                    pickle_id = dag.pickle(session).id
-                simple_dags.append(SimpleDag(dag, pickle_id=pickle_id))
-
-        dags = self._find_dags_to_process(dagbag.dags.values(), paused_dag_ids)
+        for dag in active_dags:
+            pickle_id = None
+            if pickle_dags:
+                pickle_id = dag.pickle(session).id
 
 Review comment:
   ```suggestion
                   pickle_id = dag.pickle(session).id if pickle_dags else None
   ```

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


With regards,
Apache Git Services