Skip to content

Commit

Permalink
Use a join for TI notes in TI batch API endpoint (#40028)
Browse files Browse the repository at this point in the history
  • Loading branch information
jedcunningham authored Jun 7, 2024
1 parent 80522b9 commit 4723dbe
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion airflow/api_connexion/endpoints/task_instance_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,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()

Expand Down

0 comments on commit 4723dbe

Please sign in to comment.