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 2020/01/13 15:57:20 UTC

[GitHub] [airflow] evgenyshulman commented on a change in pull request #4751: [AIRFLOW-3607] collected trigger rule dep check per dag run

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

 ##########
 File path: airflow/ti_deps/deps/trigger_rule_dep.py
 ##########
 @@ -34,11 +34,30 @@ class TriggerRuleDep(BaseTIDep):
     IGNOREABLE = True
     IS_TASK_DEP = True
 
+    @staticmethod
+    @provide_session
+    def _get_states_count_upstream_ti(ti, finished_tasks, session):
+        """
+        This function returns the states of the upstream tis for a specific ti in order to determine
+        whether this ti can run in this iteration
+
+        :param ti: the ti that we want to calculate deps for
+        :type ti: airflow.models.TaskInstance
+        :param finished_tasks: all the finished tasks of the dag_run
+        :type finished_tasks: list[airflow.models.TaskInstance]
+        """
+        if not finished_tasks:
 
 Review comment:
   it looks like you want to check that `finished_tasks is None`,   otherwise, on every new dagrun, this query will run

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services