kaxil commented on code in PR #57450:
URL: https://github.com/apache/airflow/pull/57450#discussion_r2481170341


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_run.py:
##########
@@ -368,11 +373,20 @@ def get_dag_runs(
 
     This endpoint allows specifying `~` as the dag_id to retrieve Dag Runs for 
all DAGs.
     """
-    query = select(DagRun)
+    query = select(DagRun).options(
+        joinedload(DagRun.dag_model),
+        selectinload(DagRun.task_instances)
+        .joinedload(TaskInstance.dag_version)
+        .joinedload(DagVersion.bundle),
+        selectinload(DagRun.task_instances_histories)
+        .joinedload(TaskInstanceHistory.dag_version)
+        .joinedload(DagVersion.bundle),
+        joinedload(DagRun.dag_run_note),
+    )

Review Comment:
   Can be done in follow-up but you can do something like to be DRY
   
   
https://github.com/apache/airflow/blob/96135580047e5e0c56e9f62d7d6051c86a286821/airflow-core/src/airflow/jobs/scheduler_job_runner.py#L119-L142



-- 
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