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
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from fastapi import Depends, status
from sqlalchemy import select
from sqlalchemy.orm import joinedload

from airflow.api_fastapi.common.db.common import SessionDep, paginated_select
from airflow.api_fastapi.common.parameters import (
Expand Down Expand Up @@ -64,7 +65,7 @@ def list_backfills_ui(
],
) -> BackfillCollectionResponse:
select_stmt, total_entries = paginated_select(
statement=select(Backfill),
statement=select(Backfill).options(joinedload(Backfill.dag_model)),
filters=[dag_id, active],
order_by=order_by,
offset=offset,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from airflow.models.backfill import Backfill
from airflow.utils.session import provide_session

from tests_common.test_utils.asserts import assert_queries_count
from tests_common.test_utils.db import (
clear_db_backfills,
clear_db_dag_bundles,
Expand Down Expand Up @@ -152,7 +153,8 @@ def test_should_response_200(
expected_response = []
for backfill in response_params:
expected_response.append(backfill_responses[backfill])
response = test_client.get("/backfills", params=test_params)
with assert_queries_count(2):
response = test_client.get("/backfills", params=test_params)
assert response.status_code == 200
assert response.json() == {
"backfills": expected_response,
Expand Down
Loading