Lee-W commented on code in PR #40441:
URL: https://github.com/apache/airflow/pull/40441#discussion_r1664224952
##########
airflow/api_connexion/endpoints/task_instance_endpoint.py:
##########
@@ -754,3 +754,79 @@ def get_mapped_task_instance_dependencies(
return get_task_instance_dependencies(
dag_id=dag_id, dag_run_id=dag_run_id, task_id=task_id,
map_index=map_index
)
+
+
[email protected]_access_dag("GET", DagAccessEntity.TASK_INSTANCE)
+@provide_session
+def get_task_instance_try_details(
+ *,
+ dag_id: str,
+ dag_run_id: str,
+ task_id: str,
+ task_try_number: int,
+ map_index: int = -1,
+ session: Session = NEW_SESSION,
+) -> APIResponse:
+ """Get details of a task instance try."""
+ from airflow.models.taskinstancehistory import TaskInstanceHistory
+
+ def _query(orm_object):
+ query = select(orm_object).where(
+ orm_object.dag_id == dag_id,
+ orm_object.run_id == dag_run_id,
+ orm_object.task_id == task_id,
+ orm_object.try_number == task_try_number,
+ )
+ query = query.where(orm_object.map_index == map_index)
Review Comment:
May I know why do we need to split these queries?
--
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]