feluelle commented on a change in pull request #4751: [AIRFLOW-3607] collected
trigger rule dep check per dag run
URL: https://github.com/apache/airflow/pull/4751#discussion_r342548921
##########
File path: tests/ti_deps/deps/test_trigger_rule_dep.py
##########
@@ -361,3 +366,55 @@ def test_unknown_tr(self):
self.assertEqual(len(dep_statuses), 1)
self.assertFalse(dep_statuses[0].passed)
+
+ def test_get_states_count_upstream_ti(self):
+ """
+ this test tests the helper function '_get_states_count_upstream_ti' as
a unit and inside update_state
+ """
+ get_states_count_upstream_ti =
TriggerRuleDep._get_states_count_upstream_ti
+ session = settings.Session()
+ now = timezone.utcnow()
+ dag = DAG(
+ 'test_dagrun_with_pre_tis',
+ start_date=DEFAULT_DATE,
+ default_args={'owner': 'owner1'})
+
+ with dag:
+ op1 = DummyOperator(task_id='A')
+ op2 = DummyOperator(task_id='B')
+ op3 = DummyOperator(task_id='C')
+ op4 = DummyOperator(task_id='D')
+ op5 = DummyOperator(task_id='E',
trigger_rule=TriggerRule.ONE_FAILED)
+
+ op1.set_downstream([op2, op3]) # op1 >> op2, op3
+ op4.set_upstream([op3, op2]) # op3 >> op4
Review comment:
I think it is also fine to use the `>>` operator. You just need to disable
the related pylint rule.
----------------------------------------------------------------
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