This is an automated email from the ASF dual-hosted git repository. utkarsharma pushed a commit to branch v2-9-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 60c0c7a28e03c79dc0f50aae8c91216e57303afd Author: Jed Cunningham <[email protected]> AuthorDate: Fri Jun 7 02:45:14 2024 -0600 Use a join for TI notes in TI batch API endpoint (#40028) (cherry picked from commit 4723dbe99a8240e503ad7bd7efb6da916b7addfc) --- airflow/api_connexion/endpoints/task_instance_endpoint.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/airflow/api_connexion/endpoints/task_instance_endpoint.py b/airflow/api_connexion/endpoints/task_instance_endpoint.py index a58aaee86f..aef47846f4 100644 --- a/airflow/api_connexion/endpoints/task_instance_endpoint.py +++ b/airflow/api_connexion/endpoints/task_instance_endpoint.py @@ -430,7 +430,9 @@ def get_task_instances_batch(session: Session = NEW_SESSION) -> APIResponse: ), isouter=True, ).add_columns(SlaMiss) - ti_query = base_query.options(joinedload(TI.rendered_task_instance_fields)) + ti_query = base_query.options( + joinedload(TI.rendered_task_instance_fields), joinedload(TI.task_instance_note) + ) # using execute because we want the SlaMiss entity. Scalars don't return None for missing entities task_instances = session.execute(ti_query).all()
