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/28 05:22:04 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #17265: Use `dag_maker` fixture in test_scheduler_job.py

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



##########
File path: tests/conftest.py
##########
@@ -444,11 +445,17 @@ def __exit__(self, type, value, traceback):
             dag.__exit__(type, value, traceback)
             if type is None:
                 dag.clear()
+
                 self.dag_run = dag.create_dagrun(
                     run_id=self.kwargs.get("run_id", "test"),
                     state=self.kwargs.get('state', State.RUNNING),
                     execution_date=self.kwargs.get('execution_date', self.kwargs['start_date']),
                     start_date=self.kwargs['start_date'],
+                    run_type=self.kwargs.get('run_type', DagRunType.SCHEDULED),
+                    conf=self.kwargs.get('conf', {}),
+                    dag_hash=self.kwargs.get('dag_hash', None),
+                    external_trigger=self.kwargs.get('external_trigger', False),
+                    creating_job_id=self.kwargs.get('creating_job_id', None),

Review comment:
       I wonder if it’s better to store the kwargs explicitly instead. Either directly on `DagFactory`, or with a `NamedTuple` or `TypedDict`. This is getting unwieldy.




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