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 2022/03/24 16:27:40 UTC

[GitHub] [airflow] pingzh commented on a change in pull request #22491: Add ignore_first_depends_on_past for scheduled jobs

pingzh commented on a change in pull request #22491:
URL: https://github.com/apache/airflow/pull/22491#discussion_r834500764



##########
File path: airflow/ti_deps/deps/prev_dagrun_dep.py
##########
@@ -66,6 +67,23 @@ def _get_dep_statuses(self, ti, session, dep_context):
 
         previous_ti = last_dagrun.get_task_instance(ti.task_id, session=session)
         if not previous_ti:
+            if ti.task.ignore_first_depends_on_past:
+                historical_ti = (
+                    session.query(TI)
+                    .filter(
+                        TI.dag_id == ti.dag_id,
+                        TI.task_id == ti.task_id,
+                        TI.execution_date < ti.execution_date,
+                    )
+                    .first()
+                )

Review comment:
       good idea. I have tried to use `exist` but some db does not support that. let me update it




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org