TeddyHartanto commented on a change in pull request #7735: [AIRFLOW-4549] Allow
skipped tasks to satisfy wait_for_downstream
URL: https://github.com/apache/airflow/pull/7735#discussion_r409399949
##########
File path: tests/models/test_taskinstance.py
##########
@@ -855,6 +855,20 @@ def test_check_task_dependencies(self, trigger_rule,
successes, skipped,
self.assertEqual(completed, expect_completed)
self.assertEqual(ti.state, expect_state)
+ def test_are_dependents_done(self):
+ dag = DAG(dag_id='test_dag')
+ upstream_task = DummyOperator(dag=dag, task_id='upstream_task',
start_date=DEFAULT_DATE)
+ downstream_task = DummyOperator(dag=dag, task_id='downstream_task',
start_date=DEFAULT_DATE)
+ upstream_task >> downstream_task
+ uti = TI(upstream_task, DEFAULT_DATE)
+ dti = TI(downstream_task, DEFAULT_DATE)
+ for state in State.task_states:
Review comment:
OK I can change this. Initially, I was thinking of using
`@parameterize.expand` too, but saw that there are a lot of task states:
```python3
task_states = (
SUCCESS,
RUNNING,
FAILED,
UPSTREAM_FAILED,
SKIPPED,
UP_FOR_RETRY,
UP_FOR_RESCHEDULE,
QUEUED,
NONE,
SCHEDULED,
)
```
which is why i decided to use a `for` loop that enumerates
`State.task_states` for convenience.
----------------------------------------------------------------
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]
With regards,
Apache Git Services