Skip to content

Commit b55992b

Browse files
committed
Address pr comments
1 parent 9c5fa0d commit b55992b

File tree

2 files changed

+6
-9
lines changed
  • airflow/api_fastapi/core_api/routes/public
  • tests/api_fastapi/core_api/routes/public

2 files changed

+6
-9
lines changed

airflow/api_fastapi/core_api/routes/public/xcom.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
from airflow.api_fastapi.common.router import AirflowRouter
2929
from airflow.api_fastapi.core_api.datamodels.xcom import (
3030
XComCollection,
31-
XComResponse,
3231
XComResponseNative,
3332
XComResponseString,
3433
)
@@ -135,14 +134,12 @@ def get_xcom_entries(
135134
query = query.where(XCom.key == xcom_key)
136135

137136
query, total_entries = paginated_select(
138-
select=query,
137+
statement=query,
139138
filters=[],
140139
order_by=SortParam(["dag_id", "task_id", "run_id", "map_index", "key"], XCom),
141140
offset=offset,
142141
limit=limit,
143142
session=session,
144143
)
145144
xcoms = session.scalars(query)
146-
return XComCollection(
147-
xcom_entries=[XComResponse.model_validate(xcom) for xcom in xcoms], total_entries=total_entries
148-
)
145+
return XComCollection(xcom_entries=xcoms, total_entries=total_entries)

tests/api_fastapi/core_api/routes/public/test_xcom.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ def test_custom_xcom_deserialize(
211211

212212

213213
class TestGetXComEntries(TestXComEndpoint):
214+
@pytest.fixture(autouse=True)
215+
def setup(self) -> None:
216+
self.clear_db()
217+
214218
def test_should_respond_200(self, test_client):
215219
self._create_xcom_entries(TEST_DAG_ID, run_id, logical_date_parsed, TEST_TASK_ID)
216220
response = test_client.get(
@@ -417,10 +421,6 @@ def _create_xcom_entries(self, dag_id, run_id, logical_date, task_id, mapped_ti=
417421
map_index=map_index,
418422
)
419423

420-
@pytest.fixture(autouse=True)
421-
def setup(self) -> None:
422-
self.clear_db()
423-
424424

425425
class TestPaginationGetXComEntries(TestXComEndpoint):
426426
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)