You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2025/05/30 19:46:05 UTC
(airflow) branch v3-0-test updated: [v3-0-test] Faster note on grid endpoint (#51247) (#51251)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-0-test by this push:
new 16f6b491226 [v3-0-test] Faster note on grid endpoint (#51247) (#51251)
16f6b491226 is described below
commit 16f6b491226d13e5853d3ea0699cba2c6a7e3a68
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Fri May 30 13:45:58 2025 -0600
[v3-0-test] Faster note on grid endpoint (#51247) (#51251)
For the specific scenario I'm testing, this reduces the response time
from ~9s to ~7s.
(cherry picked from commit 95bea5e723fa01bc894764ed24d85392dd190993)
Co-authored-by: Jed Cunningham <66...@users.noreply.github.com>
Co-authored-by: Ankit Chaurasia <86...@users.noreply.github.com>
---
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py
index 8d01710e780..09409335c2c 100644
--- a/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py
+++ b/airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py
@@ -24,7 +24,7 @@ from typing import Annotated
import structlog
from fastapi import Depends, HTTPException, status
from sqlalchemy import select
-from sqlalchemy.orm import joinedload
+from sqlalchemy.orm import joinedload, selectinload
from airflow import DAG
from airflow.api_fastapi.auth.managers.models.resource_details import DagAccessEntity
@@ -133,7 +133,7 @@ def grid_data(
# Retrieve, sort and encode the Task Instances
tis_of_dag_runs, _ = paginated_select(
statement=select(TaskInstance)
- .join(TaskInstance.task_instance_note, isouter=True)
+ .options(selectinload(TaskInstance.task_instance_note))
.where(TaskInstance.dag_id == dag.dag_id)
.where(TaskInstance.run_id.in_([dag_run.run_id for dag_run in dag_runs])),
filters=[],