You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2025/04/19 10:19:18 UTC

(airflow) branch main updated: Use sync calls for list backfills (#49454)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 01ed94b6372 Use sync calls for list backfills (#49454)
01ed94b6372 is described below

commit 01ed94b6372db7c8531080097acedbba12db0a0b
Author: Daniel Standish <15...@users.noreply.github.com>
AuthorDate: Sat Apr 19 03:19:13 2025 -0700

    Use sync calls for list backfills (#49454)
    
    We found issues when running this with pg bouncer. We can make it sync until we sort that stuff out.
---
 .../airflow/api_fastapi/core_api/routes/public/backfills.py   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py
index e4995cb36c3..7b2e30ba2ab 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/public/backfills.py
@@ -24,9 +24,8 @@ from sqlalchemy import select, update
 
 from airflow.api_fastapi.auth.managers.models.resource_details import DagAccessEntity
 from airflow.api_fastapi.common.db.common import (
-    AsyncSessionDep,
     SessionDep,
-    paginated_select_async,
+    paginated_select,
 )
 from airflow.api_fastapi.common.parameters import QueryLimit, QueryOffset, SortParam
 from airflow.api_fastapi.common.router import AirflowRouter
@@ -67,7 +66,7 @@ backfills_router = AirflowRouter(tags=["Backfill"], prefix="/backfills")
         Depends(requires_access_backfill(method="GET")),
     ],
 )
-async def list_backfills(
+def list_backfills(
     dag_id: str,
     limit: QueryLimit,
     offset: QueryOffset,
@@ -75,16 +74,16 @@ async def list_backfills(
         SortParam,
         Depends(SortParam(["id"], Backfill).dynamic_depends()),
     ],
-    session: AsyncSessionDep,
+    session: SessionDep,
 ) -> BackfillCollectionResponse:
-    select_stmt, total_entries = await paginated_select_async(
+    select_stmt, total_entries = paginated_select(
         statement=select(Backfill).where(Backfill.dag_id == dag_id),
         order_by=order_by,
         offset=offset,
         limit=limit,
         session=session,
     )
-    backfills = await session.scalars(select_stmt)
+    backfills = session.scalars(select_stmt)
     return BackfillCollectionResponse(
         backfills=backfills,
         total_entries=total_entries,