bbovenzi commented on code in PR #43760:
URL: https://github.com/apache/airflow/pull/43760#discussion_r1831351666
##########
airflow/api_fastapi/core_api/openapi/v1-generated.yaml:
##########
@@ -2470,6 +2470,198 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
+ /public/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/:
+ get:
+ tags:
+ - Task Instance
+ summary: Get Task Instances
+ description: Get list of mapped task instances.
+ operationId: get_task_instances
+ parameters:
+ - name: dag_id
+ in: path
+ required: true
+ schema:
+ type: string
+ title: Dag Id
+ - name: dag_run_id
+ in: path
+ required: true
+ schema:
+ type: string
+ title: Dag Run Id
+ - name: execution_date_gte
Review Comment:
execution_date is deprecated and was renamed to logical_date
##########
airflow/api_fastapi/core_api/openapi/v1-generated.yaml:
##########
@@ -2470,6 +2470,198 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
+ /public/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/:
Review Comment:
Will we support wildcard ids to list all task instances for all runs or dags?
##########
airflow/api_fastapi/core_api/routes/public/task_instances.py:
##########
@@ -198,3 +198,75 @@ async def get_mapped_task_instance(
)
return TaskInstanceResponse.model_validate(task_instance,
from_attributes=True)
+
+
+@task_instances_router.get(
+ "/",
+ responses=create_openapi_http_exception_doc(
+ [status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN,
status.HTTP_404_NOT_FOUND]
+ ),
+)
+async def get_task_instances(
+ dag_id: str,
+ dag_run_id: str,
+ request: Request,
+ execution_date_range: Annotated[
+ RangeFilter, Depends(datetime_range_filter_factory("execution_date",
TI))
+ ],
+ start_date_range: Annotated[RangeFilter,
Depends(datetime_range_filter_factory("start_date", TI))],
+ end_date_range: Annotated[RangeFilter,
Depends(datetime_range_filter_factory("end_date", TI))],
+ update_at_range: Annotated[RangeFilter,
Depends(datetime_range_filter_factory("updated_at", TI))],
+ duration_range: Annotated[RangeFilter,
Depends(float_range_filter_factory("duration", TI))],
+ state: QueryTIStateFilter,
+ pool: QueryTIPoolFilter,
+ queue: QueryTIQueueFilter,
+ executor: QueryTIExecutorFilter,
+ limit: QueryLimit,
+ offset: QueryOffset,
+ order_by: Annotated[
+ SortParam,
+ Depends(
+ SortParam(
+ ["id", "state", "duration", "start_date", "end_date",
"map_index"],
Review Comment:
I could see sort by try_number, logical_date, data_interval_start/end,
rendered_map_index would also be useful. Can be another PR.
--
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]