TeddyHartanto commented on a change in pull request #7735:
URL: https://github.com/apache/airflow/pull/7735#discussion_r421499807
##########
File path: tests/dags/test_issue_1225.py
##########
@@ -47,12 +47,7 @@ def fail():
dag=dag1,
pool='test_backfill_pooled_task_pool',)
-# DAG tests depends_on_past dependencies
-dag2 = DAG(dag_id='test_depends_on_past', default_args=default_args)
-dag2_task1 = DummyOperator(
- task_id='test_dop_task',
- dag=dag2,
- depends_on_past=True,)
+# dag2 has been moved to test_past_dagrun_deps.py
Review comment:
Yes, it only has a DAG with `depends_on_past=True`. But because this DAG
is closely related to the test DAG with `wait_for_downstream=True`, I reasoned
that we'd be better off to put them together in a new file called
`tests/dags/test_past_dagrun_deps.py`, because anyway these 2 flags are used in
`prev_dagrun_deps.py`:
```python
if previous_ti.state not in {State.SKIPPED, State.SUCCESS}:
yield self._failing_status(
reason="depends_on_past is true for this task, but the
previous task "
"instance {0} is in the state '{1}' which is not a
successful "
"state.".format(previous_ti, previous_ti.state))
previous_ti.task = ti.task
if (ti.task.wait_for_downstream and
not previous_ti.are_dependents_done(session=session)):
yield self._failing_status(
reason="The tasks downstream of the previous task instance
{0} haven't "
"completed (and wait_for_downstream is
True).".format(previous_ti))
```
----------------------------------------------------------------
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:
[email protected]