Skip to content

Commit

Permalink
Clarify new_state in OpenAPI spec (#34056)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrejeambrun authored Sep 4, 2023
1 parent c44e5b5 commit 6c649ae
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 22 deletions.
27 changes: 15 additions & 12 deletions airflow/api_connexion/openapi/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4292,12 +4292,7 @@ components:
type: boolean

new_state:
description: Expected new state.
type: string
enum:
- success
- failed
- skipped
$ref: '#/components/schemas/UpdateTaskState'

UpdateTaskInstance:
type: object
Expand All @@ -4310,12 +4305,7 @@ components:
default: false

new_state:
description: Expected new state.
type: string
enum:
- success
- failed
- skipped
$ref: '#/components/schemas/UpdateTaskState'

SetTaskInstanceNote:
type: object
Expand Down Expand Up @@ -4696,6 +4686,19 @@ components:
- removed
- restarting


UpdateTaskState:
description: |
Expected new state. Only a subset of TaskState are available.
Other states are managed directly by the scheduler or the workers and cannot be updated manually through the REST API.
type: string
enum:
- success
- failed
- skipped

DagState:
description: |
DAG State.
Expand Down
23 changes: 13 additions & 10 deletions airflow/www/static/js/types/api-generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1897,11 +1897,7 @@ export interface components {
include_future?: boolean;
/** @description If set to True, also tasks from past DAG Runs are affected. */
include_past?: boolean;
/**
* @description Expected new state.
* @enum {string}
*/
new_state?: "success" | "failed" | "skipped";
new_state?: components["schemas"]["UpdateTaskState"];
};
UpdateTaskInstance: {
/**
Expand All @@ -1911,11 +1907,7 @@ export interface components {
* @default false
*/
dry_run?: boolean;
/**
* @description Expected new state.
* @enum {string}
*/
new_state?: "success" | "failed" | "skipped";
new_state?: components["schemas"]["UpdateTaskState"];
};
SetTaskInstanceNote: {
/** @description The custom note to set for this Task Instance. */
Expand Down Expand Up @@ -2181,6 +2173,14 @@ export interface components {
| "restarting"
)
| null;
/**
* @description Expected new state. Only a subset of TaskState are available.
*
* Other states are managed directly by the scheduler or the workers and cannot be updated manually through the REST API.
*
* @enum {string}
*/
UpdateTaskState: "success" | "failed" | "skipped";
/**
* @description DAG State.
*
Expand Down Expand Up @@ -4882,6 +4882,9 @@ export type CollectionInfo = CamelCasedPropertiesDeep<
export type TaskState = CamelCasedPropertiesDeep<
components["schemas"]["TaskState"]
>;
export type UpdateTaskState = CamelCasedPropertiesDeep<
components["schemas"]["UpdateTaskState"]
>;
export type DagState = CamelCasedPropertiesDeep<
components["schemas"]["DagState"]
>;
Expand Down

0 comments on commit 6c649ae

Please sign in to comment.