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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to