Skip to content
Closed
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
4 changes: 4 additions & 0 deletions airflow-core/src/airflow/models/dagrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@

log = structlog.get_logger(__name__)

# Create a set without None for the IN clause
NON_NULL_SCHEDULABLE_STATES = SCHEDULEABLE_STATES - {None}


class TISchedulingDecision(NamedTuple):
"""Type of return for DagRun.task_instance_scheduling_decisions."""
Expand Down Expand Up @@ -2081,6 +2084,7 @@ def schedule_tis(
result = session.execute(
update(TI)
.where(TI.id.in_(id_chunk))
.where(or_(TI.state.is_(None), TI.state.in_(NON_NULL_SCHEDULABLE_STATES)))
.values(
state=TaskInstanceState.SCHEDULED,
scheduled_dttm=timezone.utcnow(),
Expand Down