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/05/07 12:22:20 UTC

[GitHub] [airflow] ashb commented on a change in pull request #8739: Test that DagFileProcessor can operator against on a Serialized DAG

ashb commented on a change in pull request #8739:
URL: https://github.com/apache/airflow/pull/8739#discussion_r421460848



##########
File path: tests/jobs/test_scheduler_job.py
##########
@@ -2253,7 +2307,17 @@ def evaluate_dagrun(
             self.null_exec.mock_task_fail(dag_id, tid, ex_date)
 
         try:
-            dag.run(start_date=ex_date, end_date=ex_date, executor=self.null_exec, **run_kwargs)
+            # This needs a _REAL_ dag, not the serialized version
+            if not isinstance(dag, SerializedDAG):
+                real_dag = dag
+            else:
+                # It may not be loaded. This "could" live in DagBag, but it's
+                # only really needed here in tests, not in normal code.
+                if dag_id not in self.non_serialized_dagbag.dag_ids:
+                    self.non_serialized_dagbag.process_file(dag.fileloc)
+
+                real_dag = self.non_serialized_dagbag.get_dag(dag_id)

Review comment:
       This _feels_ like it shouldn't be necessary, taking a look at it.




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