You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jedcunningham (via GitHub)" <gi...@apache.org> on 2025/05/29 22:03:33 UTC

[PR] Remove note from grid view response [airflow]

jedcunningham opened a new pull request, #51225:
URL: https://github.com/apache/airflow/pull/51225

   The grid view is not using the note, and the attempt at joining it didn't make it "cheap" to include, so let's just drop it.
   
   For the specific scenario I'm testing, this reduces the response time from ~9s to ~7s.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove note from grid view response [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham closed pull request #51225: Remove note from grid view response
URL: https://github.com/apache/airflow/pull/51225


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove note from grid view response [airflow]

Posted by "bbovenzi (via GitHub)" <gi...@apache.org>.
bbovenzi commented on PR #51225:
URL: https://github.com/apache/airflow/pull/51225#issuecomment-2922676307

   > I think the note was added in the past to add the marker on top of the grid icon that for a task a note is existing. That was nice but if it is a big performance hit, then I assume it is for the time being better without - also also maybe notes can be retrieved async in another call.
   
   Yes, we used to do that. But when we added task state icons, I wasn't confident that the "task has a note" indicator in the grid view was still useful or too noisy. Happy to try Ankit's suggestion, if not, we can go ahead with removing it and figuring out notes later.
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove note from grid view response [airflow]

Posted by "jscheffl (via GitHub)" <gi...@apache.org>.
jscheffl commented on PR #51225:
URL: https://github.com/apache/airflow/pull/51225#issuecomment-2921957475

   I think the note was added in the past to add the marker on top of the grid icon that for a task a note is existing. That was nice but if it is a big performance hit, then I assume it is for the time being better without - also also maybe notes can be retrieved async in another call.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove note from grid view response [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on code in PR #51225:
URL: https://github.com/apache/airflow/pull/51225#discussion_r2116198019


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py:
##########
@@ -133,7 +133,6 @@ def grid_data(
     # Retrieve, sort and encode the Task Instances
     tis_of_dag_runs, _ = paginated_select(
         statement=select(TaskInstance)

Review Comment:
   This is basically as performant. I was also aiming for a smaller response, but this field is worth keeping (I have another follow up cutting a lot more out, keep an eye out for that one 😄). Thanks! 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove note from grid view response [airflow]

Posted by "jedcunningham (via GitHub)" <gi...@apache.org>.
jedcunningham commented on PR #51225:
URL: https://github.com/apache/airflow/pull/51225#issuecomment-2922796983

   It's close enough, it's worth keeping. Moved to #51247.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Remove note from grid view response [airflow]

Posted by "sunank200 (via GitHub)" <gi...@apache.org>.
sunank200 commented on code in PR #51225:
URL: https://github.com/apache/airflow/pull/51225#discussion_r2115285009


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py:
##########
@@ -133,7 +133,6 @@ def grid_data(
     # Retrieve, sort and encode the Task Instances
     tis_of_dag_runs, _ = paginated_select(
         statement=select(TaskInstance)

Review Comment:
   ```suggestion
       tis_of_dag_runs, _ = paginated_select(
           statement=select(TaskInstance)
           .options(selectinload(TaskInstance.task_instance_note))
   ```
   Instead of dropping the note column entirely, I wonder if we can get back most of the performance win by switching from OUTER JOIN to a direct `select‐in` load on the note relationship. https://docs.sqlalchemy.org/en/13/orm/loading_relationships.html#sqlalchemy.orm.selectinload



##########
airflow-core/src/airflow/api_fastapi/core_api/routes/ui/grid.py:
##########
@@ -133,7 +133,6 @@ def grid_data(
     # Retrieve, sort and encode the Task Instances
     tis_of_dag_runs, _ = paginated_select(
         statement=select(TaskInstance)

Review Comment:
   May be something like this:
   ```
   
   statement = (
       select(TaskInstance)
       .options(selectinload(TaskInstance.task_instance_note))
       .where(TaskInstance.dag_id == dag.dag_id)
       .where(TaskInstance.run_id.in_([dr.run_id for dr in dag_runs]))
   )
   
   tis_of_dag_runs, _ = paginated_select(
       statement=statement,
       filters=[],
       order_by=SortParam(allowed_attrs=["task_id", "run_id"], model=TaskInstance).set_value("task_id"),
       offset=offset,
       limit=None,
   )
   ```
   This will emit two smaller queries. One for all TIs, one for their notes, rather than one giant join. But we'll still have `ti.note` populated. Can we try this as well and see if it improves time better?



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org