guan404ming commented on code in PR #54823:
URL: https://github.com/apache/airflow/pull/54823#discussion_r2293933511


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py:
##########
@@ -217,16 +218,7 @@ def get_grid_runs(
 ) -> list[GridRunsResponse]:
     """Get info about a run for the grid."""
     # Retrieve, sort the previous DAG Runs
-    base_query = select(
-        DagRun.dag_id,
-        DagRun.run_id,
-        DagRun.queued_at,
-        DagRun.start_date,
-        DagRun.end_date,
-        DagRun.run_after,
-        DagRun.state,
-        DagRun.run_type,
-    ).where(DagRun.dag_id == dag_id)
+    base_query = 
select(DagRun).options(joinedload(DagRun.dag_model)).where(DagRun.dag_id == 
dag_id)
 

Review Comment:
   My computer is too old to run the original PR example smoothly 🥲, so I 
simplified it before testing. The simplified dag I used is based on the same 
idea, but not exactly identical to the one in #51805.
   
   here is the example I used for test. The only difference is that the number 
of iterations is reduced to 5.
   
   ```py
   from __future__ import annotations
   
   import datetime
   
   import pendulum
   
   from airflow.providers.standard.operators.empty import EmptyOperator
   from airflow.sdk import DAG, TaskGroup, chain
   
   with DAG(
       dag_id="big_hello",
       schedule="0 0 * * *",
       start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
       catchup=False,
       dagrun_timeout=datetime.timedelta(minutes=60),
       params={"example_key": "example_value"},
   ) as dag:
       for i in range(5):
           with TaskGroup(f"group_{i}"):
               EmptyOperator(task_id="hello")
               with TaskGroup(f"group_{i}2"):
                   chain([EmptyOperator(task_id=f"empty_{j}") for j in 
range(5)])
                   chain([EmptyOperator(task_id=f"empty2_{j}") for j in 
range(5)])
                   # 
EmptyOperator.partial(task_id=f"hello2").expand(doc=list(range(5)))
               with TaskGroup(f"group_{i}3"):
                   chain([EmptyOperator(task_id=f"empty_{j}") for j in 
range(5)])
                   chain([EmptyOperator(task_id=f"empty2_{j}") for j in 
range(5)])
                   # 
EmptyOperator.partial(task_id=f"hello2").expand(doc=list(range(5)))
               with TaskGroup(f"group_{i}4"):
                   chain([EmptyOperator(task_id=f"empty_{j}") for j in 
range(5)])
                   chain([EmptyOperator(task_id=f"empty2_{j}") for j in 
range(5)])
                   # 
EmptyOperator.partial(task_id=f"hello2").expand(doc=list(range(5)))
   
   ```



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