From 6f02fdbe2e917d20482fd31c1b090b5d6d880320 Mon Sep 17 00:00:00 2001 From: kandharvishnu <46064835+kandharvishnu@users.noreply.github.com> Date: Mon, 18 Nov 2024 15:14:27 +0530 Subject: [PATCH] get_task_instance_try_details API returns TaskInstanceHistory schema (#43830) * Update v1.yaml these - get_task_instance_try_details - get_mapped_task_instance_try_details - get_task_instance_tries - get_mapped_task_instance_tries are actually returning TaskInstanceHistory * Update v1.yaml * dummy change * revert "dummy change" * Update api-generated.ts * Update api-generated.ts * Update api-generated.ts * Update api-generated.ts * changes to v1.yaml * Update api-generated.ts * removing execution_date --------- Co-authored-by: kandharvishnuu <148410552+kandharvishnuu@users.noreply.github.com> --- airflow/api_connexion/openapi/v1.yaml | 96 +++++++++++++++++++- airflow/www/static/js/types/api-generated.ts | 65 ++++++++++++- 2 files changed, 153 insertions(+), 8 deletions(-) diff --git a/airflow/api_connexion/openapi/v1.yaml b/airflow/api_connexion/openapi/v1.yaml index 10cee57d95fc..244349fb946a 100644 --- a/airflow/api_connexion/openapi/v1.yaml +++ b/airflow/api_connexion/openapi/v1.yaml @@ -1751,7 +1751,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TaskInstance" + $ref: "#/components/schemas/TaskInstanceHistory" "401": $ref: "#/components/responses/Unauthenticated" "403": @@ -1782,7 +1782,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TaskInstanceCollection" + $ref: "#/components/schemas/TaskInstanceHistoryCollection" "401": $ref: "#/components/responses/Unauthenticated" "403": @@ -1814,7 +1814,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TaskInstanceCollection" + $ref: "#/components/schemas/TaskInstanceHistoryCollection" "401": $ref: "#/components/responses/Unauthenticated" "403": @@ -1844,7 +1844,7 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/TaskInstance" + $ref: "#/components/schemas/TaskInstanceHistory" "401": $ref: "#/components/responses/Unauthenticated" "403": @@ -3763,7 +3763,95 @@ components: items: $ref: "#/components/schemas/TaskInstance" - $ref: "#/components/schemas/CollectionInfo" + TaskInstanceHistory: + type: object + properties: + task_id: + type: string + task_display_name: + type: string + description: | + Human centric display text for the task. + *New in version 2.9.0* + dag_id: + type: string + dag_run_id: + type: string + description: | + The DagRun ID for this task instance + + *New in version 2.3.0* + start_date: + type: string + format: datetime + nullable: true + end_date: + type: string + format: datetime + nullable: true + duration: + type: number + nullable: true + state: + $ref: "#/components/schemas/TaskState" + try_number: + type: integer + map_index: + type: integer + max_tries: + type: integer + hostname: + type: string + unixname: + type: string + pool: + type: string + pool_slots: + type: integer + queue: + type: string + nullable: true + priority_weight: + type: integer + nullable: true + operator: + type: string + nullable: true + description: | + *Changed in version 2.1.1*: Field becomes nullable. + queued_when: + type: string + nullable: true + description: | + The datetime that the task enter the state QUEUE, also known as queue_at + pid: + type: integer + nullable: true + executor: + type: string + nullable: true + description: | + Executor the task is configured to run on or None (which indicates the default executor) + + *New in version 2.10.0* + executor_config: + type: string + + TaskInstanceHistoryCollection: + type: object + description: | + Collection of task instances . + + *Changed in version 2.1.0*: 'total_entries' field is added. + allOf: + - type: object + properties: + task_instances_history: + type: array + items: + $ref: "#/components/schemas/TaskInstanceHistory" + - $ref: "#/components/schemas/CollectionInfo" TaskInstanceReference: type: object properties: diff --git a/airflow/www/static/js/types/api-generated.ts b/airflow/www/static/js/types/api-generated.ts index 0f91a2329dd2..1d68b650acbf 100644 --- a/airflow/www/static/js/types/api-generated.ts +++ b/airflow/www/static/js/types/api-generated.ts @@ -1526,6 +1526,57 @@ export interface components { TaskInstanceCollection: { task_instances?: components["schemas"]["TaskInstance"][]; } & components["schemas"]["CollectionInfo"]; + TaskInstanceHistory: { + task_id?: string; + /** + * @description Human centric display text for the task. + * + * *New in version 2.9.0* + */ + task_display_name?: string; + dag_id?: string; + /** + * @description The DagRun ID for this task instance + * + * *New in version 2.3.0* + */ + dag_run_id?: string; + /** Format: datetime */ + start_date?: string | null; + /** Format: datetime */ + end_date?: string | null; + duration?: number | null; + state?: components["schemas"]["TaskState"]; + try_number?: number; + map_index?: number; + max_tries?: number; + hostname?: string; + unixname?: string; + pool?: string; + pool_slots?: number; + queue?: string | null; + priority_weight?: number | null; + /** @description *Changed in version 2.1.1*: Field becomes nullable. */ + operator?: string | null; + /** @description The datetime that the task enter the state QUEUE, also known as queue_at */ + queued_when?: string | null; + pid?: number | null; + /** + * @description Executor the task is configured to run on or None (which indicates the default executor) + * + * *New in version 2.10.0* + */ + executor?: string | null; + executor_config?: string; + }; + /** + * @description Collection of task instances . + * + * *Changed in version 2.1.0*: 'total_entries' field is added. + */ + TaskInstanceHistoryCollection: { + task_instances_history?: components["schemas"]["TaskInstanceHistory"][]; + } & components["schemas"]["CollectionInfo"]; TaskInstanceReference: { /** @description The task ID. */ task_id?: string; @@ -4378,7 +4429,7 @@ export interface operations { /** Success. */ 200: { content: { - "application/json": components["schemas"]["TaskInstance"]; + "application/json": components["schemas"]["TaskInstanceHistory"]; }; }; 401: components["responses"]["Unauthenticated"]; @@ -4419,7 +4470,7 @@ export interface operations { /** Success. */ 200: { content: { - "application/json": components["schemas"]["TaskInstanceCollection"]; + "application/json": components["schemas"]["TaskInstanceHistoryCollection"]; }; }; 401: components["responses"]["Unauthenticated"]; @@ -4462,7 +4513,7 @@ export interface operations { /** Success. */ 200: { content: { - "application/json": components["schemas"]["TaskInstanceCollection"]; + "application/json": components["schemas"]["TaskInstanceHistoryCollection"]; }; }; 401: components["responses"]["Unauthenticated"]; @@ -4494,7 +4545,7 @@ export interface operations { /** Success. */ 200: { content: { - "application/json": components["schemas"]["TaskInstance"]; + "application/json": components["schemas"]["TaskInstanceHistory"]; }; }; 401: components["responses"]["Unauthenticated"]; @@ -5296,6 +5347,12 @@ export type TaskInstance = CamelCasedPropertiesDeep< export type TaskInstanceCollection = CamelCasedPropertiesDeep< components["schemas"]["TaskInstanceCollection"] >; +export type TaskInstanceHistory = CamelCasedPropertiesDeep< + components["schemas"]["TaskInstanceHistory"] +>; +export type TaskInstanceHistoryCollection = CamelCasedPropertiesDeep< + components["schemas"]["TaskInstanceHistoryCollection"] +>; export type TaskInstanceReference = CamelCasedPropertiesDeep< components["schemas"]["TaskInstanceReference"] >;