File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/airflow/api_fastapi/core_api/routes/ui
tests/unit/api_fastapi/core_api/routes/ui Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 2020
2121from fastapi import Depends , status
2222from sqlalchemy import select
23+ from sqlalchemy .orm import joinedload
2324
2425from airflow .api_fastapi .common .db .common import SessionDep , paginated_select
2526from airflow .api_fastapi .common .parameters import (
@@ -64,7 +65,7 @@ def list_backfills_ui(
6465 ],
6566) -> BackfillCollectionResponse :
6667 select_stmt , total_entries = paginated_select (
67- statement = select (Backfill ),
68+ statement = select (Backfill ). options ( joinedload ( Backfill . dag_model )) ,
6869 filters = [dag_id , active ],
6970 order_by = order_by ,
7071 offset = offset ,
Original file line number Diff line number Diff line change 2525from airflow .models .backfill import Backfill
2626from airflow .utils .session import provide_session
2727
28+ from tests_common .test_utils .asserts import assert_queries_count
2829from tests_common .test_utils .db import (
2930 clear_db_backfills ,
3031 clear_db_dag_bundles ,
@@ -152,7 +153,8 @@ def test_should_response_200(
152153 expected_response = []
153154 for backfill in response_params :
154155 expected_response .append (backfill_responses [backfill ])
155- response = test_client .get ("/backfills" , params = test_params )
156+ with assert_queries_count (2 ):
157+ response = test_client .get ("/backfills" , params = test_params )
156158 assert response .status_code == 200
157159 assert response .json () == {
158160 "backfills" : expected_response ,
You can’t perform that action at this time.
0 commit comments