Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions airflow/models/dagrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ def verify_integrity(self, *, session: Session = NEW_SESSION) -> None:

def task_filter(task: Operator) -> bool:
return task.task_id not in task_ids and (
self.is_backfill
self.run_type == DagRunType.BACKFILL_JOB
or (task.start_date is None or task.start_date <= self.execution_date)
and (task.end_date is None or self.execution_date <= task.end_date)
)
Expand Down Expand Up @@ -1538,10 +1538,6 @@ def _revise_map_indexes_if_mapped(self, task: Operator, *, session: Session) ->
session.flush()
yield ti

@property
def is_backfill(self) -> bool:
return self.run_type == DagRunType.BACKFILL_JOB

@classmethod
@provide_session
def get_latest_runs(cls, session: Session = NEW_SESSION) -> list[DagRun]:
Expand Down
1 change: 1 addition & 0 deletions newsfragments/42548.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove is_backfill attribute from DagRun object
5 changes: 2 additions & 3 deletions tests/jobs/test_scheduler_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,7 @@ def test_execute_task_instances_backfill_tasks_wont_execute(self, dag_maker):
ti1.state = State.SCHEDULED
session.merge(ti1)
session.flush()

assert dr1.is_backfill
assert dr1.run_type == DagRunType.BACKFILL_JOB

self.job_runner._critical_section_enqueue_task_instances(session)
session.flush()
Expand Down Expand Up @@ -3851,7 +3850,7 @@ def test_adopt_or_reset_orphaned_tasks_backfill_dag(self, dag_maker):
session.merge(dr1)
session.flush()

assert dr1.is_backfill
assert dr1.run_type == DagRunType.BACKFILL_JOB
assert 0 == self.job_runner.adopt_or_reset_orphaned_tasks(session=session)
session.rollback()

Expand Down