Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions airflow/ti_deps/deps/prev_dagrun_dep.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from airflow.ti_deps.deps.base_ti_dep import BaseTIDep
from airflow.utils.db import exists_query
from airflow.utils.session import provide_session
from airflow.utils.state import TaskInstanceState
from airflow.utils.state import DagRunState, TaskInstanceState

if TYPE_CHECKING:
from sqlalchemy.orm import Session
Expand Down Expand Up @@ -157,7 +157,11 @@ def _get_dep_statuses(self, ti: TI, session: Session, dep_context):
return

# There was a DAG run, but the task wasn't active back then.
if catchup and last_dagrun.execution_date < ti.task.start_date:
if (
catchup
and last_dagrun.state != DagRunState.RUNNING
and last_dagrun.execution_date < ti.task.start_date
):
self._push_past_deps_met_xcom_if_needed(ti, dep_context)
yield self._passing_status(reason="This task instance was the first task instance for its task.")
return
Expand Down