This is an automated email from the ASF dual-hosted git repository. Lee-W pushed a commit to branch backfill-empty-window-ux in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 658e19021dafa954dfbe6126316ef5224aba276c Author: Wei Lee <[email protected]> AuthorDate: Thu Jul 2 14:42:07 2026 +0800 Rewrite misleading logic --- airflow-core/tests/unit/models/test_backfill.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airflow-core/tests/unit/models/test_backfill.py b/airflow-core/tests/unit/models/test_backfill.py index bd1a4c1877c..ea621be84d6 100644 --- a/airflow-core/tests/unit/models/test_backfill.py +++ b/airflow-core/tests/unit/models/test_backfill.py @@ -24,7 +24,7 @@ from unittest import mock import pendulum import pytest -from sqlalchemy import select +from sqlalchemy import func, select from airflow._shared.timezones import timezone from airflow.models import DagModel, DagRun, TaskInstance @@ -1453,12 +1453,12 @@ def test_create_backfill_real_empty_window_no_orphan(dag_maker, session): # No orphan: zero incomplete Backfill rows for this dag orphan_count = session.scalar( - select(Backfill).where( + select(func.count()).where( Backfill.dag_id == dag.dag_id, Backfill.completed_at.is_(None), ) ) - assert orphan_count is None, "An orphan Backfill row was left behind after NoBackfillRunsToCreate" + assert orphan_count == 0, "An orphan Backfill row was left behind after NoBackfillRunsToCreate" # A valid (Monday) window must not be blocked by AlreadyRunningBackfill monday = pendulum.datetime(2026, 2, 23, tz="UTC") # a Monday
