pierrejeambrun commented on code in PR #57425:
URL: https://github.com/apache/airflow/pull/57425#discussion_r2469660533


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py:
##########
@@ -18,16 +18,16 @@
 from __future__ import annotations
 
 from airflow.api_fastapi.core_api.base import BaseModel
-from airflow.api_fastapi.core_api.datamodels.dag_run import DAGRunResponse
 from airflow.api_fastapi.core_api.datamodels.dags import DAGResponse
 from airflow.api_fastapi.core_api.datamodels.hitl import HITLDetail
+from airflow.api_fastapi.core_api.datamodels.ui.dag_runs import 
DAGRunLightResponse
 
 
 class DAGWithLatestDagRunsResponse(DAGResponse):
     """DAG with latest dag runs response serializer."""
 
     asset_expression: dict | None
-    latest_dag_runs: list[DAGRunResponse]
+    latest_dag_runs: list[DAGRunLightResponse]

Review Comment:
   We probably can't do that. it impacts the public API, and that would be a 
breaking change of the API. 
   
   The other alternative is to add the missing loading options to the queries 
so we eargerly load relationship in one single query and avoid the n+1 lazy 
queries at serialization time.
   
   Or maybe we can justify breaking the API for a performance bug I assume ?



##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/dags.py:
##########
@@ -18,16 +18,16 @@
 from __future__ import annotations
 
 from airflow.api_fastapi.core_api.base import BaseModel
-from airflow.api_fastapi.core_api.datamodels.dag_run import DAGRunResponse
 from airflow.api_fastapi.core_api.datamodels.dags import DAGResponse
 from airflow.api_fastapi.core_api.datamodels.hitl import HITLDetail
+from airflow.api_fastapi.core_api.datamodels.ui.dag_runs import 
DAGRunLightResponse
 
 
 class DAGWithLatestDagRunsResponse(DAGResponse):
     """DAG with latest dag runs response serializer."""
 
     asset_expression: dict | None
-    latest_dag_runs: list[DAGRunResponse]
+    latest_dag_runs: list[DAGRunLightResponse]

Review Comment:
   We probably can't do that. it impacts the public API, and that would be a 
breaking change of the API. 
   
   The other alternative is to add the missing loading options to the queries 
so we eargerly load relationship in one single query and avoid the n+1 lazy 
queries at serialization time.
   
   Or maybe we can justify breaking the API for a performance bug ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to