Skip to content

Commit

Permalink
Re-run static checks
Browse files Browse the repository at this point in the history
  • Loading branch information
omkar-foss committed Nov 13, 2024
1 parent 76c04aa commit 2e1d174
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 0 deletions.
74 changes: 74 additions & 0 deletions airflow/api_fastapi/core_api/openapi/v1-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2977,6 +2977,64 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/public/dags/{dag_id}/tasks/:
get:
tags:
- Task
summary: Get Tasks
description: Get tasks for DAG.
operationId: get_tasks
parameters:
- name: dag_id
in: path
required: true
schema:
type: string
title: Dag Id
- name: order_by
in: query
required: false
schema:
type: string
default: task_id
title: Order By
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/TaskCollectionResponse'
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Forbidden
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Not Found
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/public/dags/{dag_id}/tasks/{task_id}:
get:
tags:
Expand Down Expand Up @@ -5178,6 +5236,22 @@ components:
- latest_scheduler_heartbeat
title: SchedulerInfoSchema
description: Schema for Scheduler info.
TaskCollectionResponse:
properties:
tasks:
items:
$ref: '#/components/schemas/TaskResponse'
type: array
title: Tasks
total_entries:
type: integer
title: Total Entries
type: object
required:
- tasks
- total_entries
title: TaskCollectionResponse
description: Task collection serializer for responses.
TaskDependencyCollectionResponse:
properties:
dependencies:
Expand Down
18 changes: 18 additions & 0 deletions airflow/ui/openapi-gen/queries/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,24 @@ export const UseTaskInstanceServiceGetTaskInstancesKeyFn = (
},
]),
];
export type TaskServiceGetTasksDefaultResponse = Awaited<
ReturnType<typeof TaskService.getTasks>
>;
export type TaskServiceGetTasksQueryResult<
TData = TaskServiceGetTasksDefaultResponse,
TError = unknown,
> = UseQueryResult<TData, TError>;
export const useTaskServiceGetTasksKey = "TaskServiceGetTasks";
export const UseTaskServiceGetTasksKeyFn = (
{
dagId,
orderBy,
}: {
dagId: string;
orderBy?: string;
},
queryKey?: Array<unknown>,
) => [useTaskServiceGetTasksKey, ...(queryKey ?? [{ dagId, orderBy }])];
export type TaskServiceGetTaskDefaultResponse = Awaited<
ReturnType<typeof TaskService.getTask>
>;
Expand Down
23 changes: 23 additions & 0 deletions airflow/ui/openapi-gen/queries/prefetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,29 @@ export const prefetchUseTaskInstanceServiceGetTaskInstances = (
updatedAtLte,
}),
});
/**
* Get Tasks
* Get tasks for DAG.
* @param data The data for the request.
* @param data.dagId
* @param data.orderBy
* @returns TaskCollectionResponse Successful Response
* @throws ApiError
*/
export const prefetchUseTaskServiceGetTasks = (
queryClient: QueryClient,
{
dagId,
orderBy,
}: {
dagId: string;
orderBy?: string;
},
) =>
queryClient.prefetchQuery({
queryKey: Common.UseTaskServiceGetTasksKeyFn({ dagId, orderBy }),
queryFn: () => TaskService.getTasks({ dagId, orderBy }),
});
/**
* Get Task
* Get simplified representation of a task.
Expand Down
29 changes: 29 additions & 0 deletions airflow/ui/openapi-gen/queries/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,35 @@ export const useTaskInstanceServiceGetTaskInstances = <
}) as TData,
...options,
});
/**
* Get Tasks
* Get tasks for DAG.
* @param data The data for the request.
* @param data.dagId
* @param data.orderBy
* @returns TaskCollectionResponse Successful Response
* @throws ApiError
*/
export const useTaskServiceGetTasks = <
TData = Common.TaskServiceGetTasksDefaultResponse,
TError = unknown,
TQueryKey extends Array<unknown> = unknown[],
>(
{
dagId,
orderBy,
}: {
dagId: string;
orderBy?: string;
},
queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
) =>
useQuery<TData, TError>({
queryKey: Common.UseTaskServiceGetTasksKeyFn({ dagId, orderBy }, queryKey),
queryFn: () => TaskService.getTasks({ dagId, orderBy }) as TData,
...options,
});
/**
* Get Task
* Get simplified representation of a task.
Expand Down
29 changes: 29 additions & 0 deletions airflow/ui/openapi-gen/queries/suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1415,6 +1415,35 @@ export const useTaskInstanceServiceGetTaskInstancesSuspense = <
}) as TData,
...options,
});
/**
* Get Tasks
* Get tasks for DAG.
* @param data The data for the request.
* @param data.dagId
* @param data.orderBy
* @returns TaskCollectionResponse Successful Response
* @throws ApiError
*/
export const useTaskServiceGetTasksSuspense = <
TData = Common.TaskServiceGetTasksDefaultResponse,
TError = unknown,
TQueryKey extends Array<unknown> = unknown[],
>(
{
dagId,
orderBy,
}: {
dagId: string;
orderBy?: string;
},
queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
) =>
useSuspenseQuery<TData, TError>({
queryKey: Common.UseTaskServiceGetTasksKeyFn({ dagId, orderBy }, queryKey),
queryFn: () => TaskService.getTasks({ dagId, orderBy }) as TData,
...options,
});
/**
* Get Task
* Get simplified representation of a task.
Expand Down
20 changes: 20 additions & 0 deletions airflow/ui/openapi-gen/requests/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2708,6 +2708,26 @@ export const $SchedulerInfoSchema = {
description: "Schema for Scheduler info.",
} as const;

export const $TaskCollectionResponse = {
properties: {
tasks: {
items: {
$ref: "#/components/schemas/TaskResponse",
},
type: "array",
title: "Tasks",
},
total_entries: {
type: "integer",
title: "Total Entries",
},
},
type: "object",
required: ["tasks", "total_entries"],
title: "TaskCollectionResponse",
description: "Task collection serializer for responses.",
} as const;

export const $TaskDependencyCollectionResponse = {
properties: {
dependencies: {
Expand Down
33 changes: 33 additions & 0 deletions airflow/ui/openapi-gen/requests/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ import type {
GetMappedTaskInstanceResponse,
GetTaskInstancesData,
GetTaskInstancesResponse,
GetTasksData,
GetTasksResponse,
GetTaskData,
GetTaskResponse,
DeleteVariableData,
Expand Down Expand Up @@ -1605,6 +1607,37 @@ export class TaskInstanceService {
}

export class TaskService {
/**
* Get Tasks
* Get tasks for DAG.
* @param data The data for the request.
* @param data.dagId
* @param data.orderBy
* @returns TaskCollectionResponse Successful Response
* @throws ApiError
*/
public static getTasks(
data: GetTasksData,
): CancelablePromise<GetTasksResponse> {
return __request(OpenAPI, {
method: "GET",
url: "/public/dags/{dag_id}/tasks/",
path: {
dag_id: data.dagId,
},
query: {
order_by: data.orderBy,
},
errors: {
400: "Bad Request",
401: "Unauthorized",
403: "Forbidden",
404: "Not Found",
422: "Validation Error",
},
});
}

/**
* Get Task
* Get simplified representation of a task.
Expand Down
46 changes: 46 additions & 0 deletions airflow/ui/openapi-gen/requests/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,14 @@ export type SchedulerInfoSchema = {
latest_scheduler_heartbeat: string | null;
};

/**
* Task collection serializer for responses.
*/
export type TaskCollectionResponse = {
tasks: Array<TaskResponse>;
total_entries: number;
};

/**
* Task scheduling dependencies collection serializer for responses.
*/
Expand Down Expand Up @@ -1317,6 +1325,13 @@ export type GetTaskInstancesData = {

export type GetTaskInstancesResponse = TaskInstanceCollectionResponse;

export type GetTasksData = {
dagId: string;
orderBy?: string;
};

export type GetTasksResponse = TaskCollectionResponse;

export type GetTaskData = {
dagId: string;
taskId: unknown;
Expand Down Expand Up @@ -2575,6 +2590,37 @@ export type $OpenApiTs = {
};
};
};
"/public/dags/{dag_id}/tasks/": {
get: {
req: GetTasksData;
res: {
/**
* Successful Response
*/
200: TaskCollectionResponse;
/**
* Bad Request
*/
400: HTTPExceptionResponse;
/**
* Unauthorized
*/
401: HTTPExceptionResponse;
/**
* Forbidden
*/
403: HTTPExceptionResponse;
/**
* Not Found
*/
404: HTTPExceptionResponse;
/**
* Validation Error
*/
422: HTTPValidationError;
};
};
};
"/public/dags/{dag_id}/tasks/{task_id}": {
get: {
req: GetTaskData;
Expand Down

0 comments on commit 2e1d174

Please sign in to comment.