Skip to content

Commit

Permalink
Fix duplicate TaskInstanceState entity in FastApi Schema (apache#43824
Browse files Browse the repository at this point in the history
)

It was the cause of apache#43823 (comment)

```
airflow__api_fastapi__core_api__datamodels__ui__dashboard__TaskInstanceState
TaskInstanceState
```
  • Loading branch information
kaxil authored Nov 8, 2024
1 parent 2b79d18 commit ccb18ab
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 223 deletions.
4 changes: 2 additions & 2 deletions airflow/api_fastapi/core_api/datamodels/ui/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class DAGRunStates(BaseModel):
failed: int


class TaskInstanceState(BaseModel):
class TaskInstanceStateCount(BaseModel):
"""TaskInstance serializer for responses."""

no_status: int
Expand All @@ -60,4 +60,4 @@ class HistoricalMetricDataResponse(BaseModel):

dag_run_types: DAGRunTypes
dag_run_states: DAGRunStates
task_instance_states: TaskInstanceState
task_instance_states: TaskInstanceStateCount
160 changes: 80 additions & 80 deletions airflow/api_fastapi/core_api/openapi/v1-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4336,7 +4336,7 @@ components:
dag_run_states:
$ref: '#/components/schemas/DAGRunStates'
task_instance_states:
$ref: '#/components/schemas/airflow__api_fastapi__core_api__datamodels__ui__dashboard__TaskInstanceState'
$ref: '#/components/schemas/TaskInstanceStateCount'
type: object
required:
- dag_run_types
Expand Down Expand Up @@ -4798,7 +4798,7 @@ components:
title: Duration
state:
anyOf:
- $ref: '#/components/schemas/airflow__utils__state__TaskInstanceState'
- $ref: '#/components/schemas/TaskInstanceState'
- type: 'null'
try_number:
type: integer
Expand Down Expand Up @@ -4913,6 +4913,84 @@ components:
- triggerer_job
title: TaskInstanceResponse
description: TaskInstance serializer for responses.
TaskInstanceState:
type: string
enum:
- removed
- scheduled
- queued
- running
- success
- restarting
- failed
- up_for_retry
- up_for_reschedule
- upstream_failed
- skipped
- deferred
title: TaskInstanceState
description: 'All possible states that a Task Instance can be in.
Note that None is also allowed, so always use this in a type hint with Optional.'
TaskInstanceStateCount:
properties:
no_status:
type: integer
title: No Status
removed:
type: integer
title: Removed
scheduled:
type: integer
title: Scheduled
queued:
type: integer
title: Queued
running:
type: integer
title: Running
success:
type: integer
title: Success
restarting:
type: integer
title: Restarting
failed:
type: integer
title: Failed
up_for_retry:
type: integer
title: Up For Retry
up_for_reschedule:
type: integer
title: Up For Reschedule
upstream_failed:
type: integer
title: Upstream Failed
skipped:
type: integer
title: Skipped
deferred:
type: integer
title: Deferred
type: object
required:
- no_status
- removed
- scheduled
- queued
- running
- success
- restarting
- failed
- up_for_retry
- up_for_reschedule
- upstream_failed
- skipped
- deferred
title: TaskInstanceStateCount
description: TaskInstance serializer for responses.
TriggerResponse:
properties:
id:
Expand Down Expand Up @@ -5056,81 +5134,3 @@ components:
- git_version
title: VersionInfo
description: Version information serializer for responses.
airflow__api_fastapi__core_api__datamodels__ui__dashboard__TaskInstanceState:
properties:
no_status:
type: integer
title: No Status
removed:
type: integer
title: Removed
scheduled:
type: integer
title: Scheduled
queued:
type: integer
title: Queued
running:
type: integer
title: Running
success:
type: integer
title: Success
restarting:
type: integer
title: Restarting
failed:
type: integer
title: Failed
up_for_retry:
type: integer
title: Up For Retry
up_for_reschedule:
type: integer
title: Up For Reschedule
upstream_failed:
type: integer
title: Upstream Failed
skipped:
type: integer
title: Skipped
deferred:
type: integer
title: Deferred
type: object
required:
- no_status
- removed
- scheduled
- queued
- running
- success
- restarting
- failed
- up_for_retry
- up_for_reschedule
- upstream_failed
- skipped
- deferred
title: TaskInstanceState
description: TaskInstance serializer for responses.
airflow__utils__state__TaskInstanceState:
type: string
enum:
- removed
- scheduled
- queued
- running
- success
- restarting
- failed
- up_for_retry
- up_for_reschedule
- upstream_failed
- skipped
- deferred
title: TaskInstanceState
description: 'All possible states that a Task Instance can be in.
Note that None is also allowed, so always use this in a type hint with Optional.'
Loading

0 comments on commit ccb18ab

Please sign in to comment.