ephraimbuddy commented on a change in pull request #17324:
URL: https://github.com/apache/airflow/pull/17324#discussion_r679708043
##########
File path: tests/conftest.py
##########
@@ -444,33 +445,44 @@ 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'],
- )
+
+ def _set_default_args(self, kwargs, defaults):
+ for k, v in defaults.items():
+ if k not in kwargs:
+ kwargs.setdefault(k, v)
+
+ @provide_session
+ def make_dagmodel(self, session=None, **kwargs):
+ dag = self.dag
+ defaults = dict(dag_id=dag.dag_id, next_dagrun=dag.start_date,
is_active=True)
+ self._set_default_args(kwargs, defaults)
Review comment:
This is so apt! Thanks!
--
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]