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 Oct 23, 2024
1 parent c98911c commit a3a80ec
Show file tree
Hide file tree
Showing 8 changed files with 338 additions and 0 deletions.
98 changes: 98 additions & 0 deletions airflow/api_fastapi/core_api/openapi/v1-generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,59 @@ paths:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/public/dagStats/:
get:
tags:
- DagStats
summary: Get Dag Stats
description: Get Dag statistics.
operationId: get_dag_stats
parameters:
- name: dag_ids
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Dag Ids
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/DagStatsCollectionResponse'
'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':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPExceptionResponse'
description: Unprocessable Entity
components:
schemas:
AppBuilderMenuItemResponse:
Expand Down Expand Up @@ -2032,6 +2085,51 @@ components:
- asset_triggered
title: DagRunType
description: Class with DagRun types.
DagStatsCollectionResponse:
properties:
dags:
items:
$ref: '#/components/schemas/DagStatsResponse'
type: array
title: Dags
total_entries:
type: integer
title: Total Entries
type: object
required:
- dags
- total_entries
title: DagStatsCollectionResponse
description: DAG Stats Collection serializer for responses.
DagStatsResponse:
properties:
dag_id:
type: string
title: Dag Id
stats:
items:
$ref: '#/components/schemas/DagStatsStateResponse'
type: array
title: Stats
type: object
required:
- dag_id
- stats
title: DagStatsResponse
description: DAG Stats serializer for responses.
DagStatsStateResponse:
properties:
state:
$ref: '#/components/schemas/DagRunState'
count:
type: integer
title: Count
type: object
required:
- state
- count
title: DagStatsStateResponse
description: DagStatsState serializer for responses.
DagTagPydantic:
properties:
name:
Expand Down
17 changes: 17 additions & 0 deletions airflow/ui/openapi-gen/queries/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ConnectionService,
DagRunService,
DagService,
DagStatsService,
DashboardService,
MonitorService,
PluginService,
Expand Down Expand Up @@ -345,6 +346,22 @@ export const UsePluginServiceGetPluginsKeyFn = (
} = {},
queryKey?: Array<unknown>,
) => [usePluginServiceGetPluginsKey, ...(queryKey ?? [{ limit, offset }])];
export type DagStatsServiceGetDagStatsDefaultResponse = Awaited<
ReturnType<typeof DagStatsService.getDagStats>
>;
export type DagStatsServiceGetDagStatsQueryResult<
TData = DagStatsServiceGetDagStatsDefaultResponse,
TError = unknown,
> = UseQueryResult<TData, TError>;
export const useDagStatsServiceGetDagStatsKey = "DagStatsServiceGetDagStats";
export const UseDagStatsServiceGetDagStatsKeyFn = (
{
dagIds,
}: {
dagIds?: string;
} = {},
queryKey?: Array<unknown>,
) => [useDagStatsServiceGetDagStatsKey, ...(queryKey ?? [{ dagIds }])];
export type VariableServicePostVariableMutationResult = Awaited<
ReturnType<typeof VariableService.postVariable>
>;
Expand Down
21 changes: 21 additions & 0 deletions airflow/ui/openapi-gen/queries/prefetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ConnectionService,
DagRunService,
DagService,
DagStatsService,
DashboardService,
MonitorService,
PluginService,
Expand Down Expand Up @@ -429,3 +430,23 @@ export const prefetchUsePluginServiceGetPlugins = (
queryKey: Common.UsePluginServiceGetPluginsKeyFn({ limit, offset }),
queryFn: () => PluginService.getPlugins({ limit, offset }),
});
/**
* Get Dag Stats
* Get Dag statistics.
* @param data The data for the request.
* @param data.dagIds
* @returns DagStatsCollectionResponse Successful Response
* @throws ApiError
*/
export const prefetchUseDagStatsServiceGetDagStats = (
queryClient: QueryClient,
{
dagIds,
}: {
dagIds?: string;
} = {},
) =>
queryClient.prefetchQuery({
queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }),
queryFn: () => DagStatsService.getDagStats({ dagIds }),
});
27 changes: 27 additions & 0 deletions airflow/ui/openapi-gen/queries/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
ConnectionService,
DagRunService,
DagService,
DagStatsService,
DashboardService,
MonitorService,
PluginService,
Expand Down Expand Up @@ -557,6 +558,32 @@ export const usePluginServiceGetPlugins = <
queryFn: () => PluginService.getPlugins({ limit, offset }) as TData,
...options,
});
/**
* Get Dag Stats
* Get Dag statistics.
* @param data The data for the request.
* @param data.dagIds
* @returns DagStatsCollectionResponse Successful Response
* @throws ApiError
*/
export const useDagStatsServiceGetDagStats = <
TData = Common.DagStatsServiceGetDagStatsDefaultResponse,
TError = unknown,
TQueryKey extends Array<unknown> = unknown[],
>(
{
dagIds,
}: {
dagIds?: string;
} = {},
queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
) =>
useQuery<TData, TError>({
queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }, queryKey),
queryFn: () => DagStatsService.getDagStats({ dagIds }) as TData,
...options,
});
/**
* Post Variable
* Create a variable.
Expand Down
27 changes: 27 additions & 0 deletions airflow/ui/openapi-gen/queries/suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ConnectionService,
DagRunService,
DagService,
DagStatsService,
DashboardService,
MonitorService,
PluginService,
Expand Down Expand Up @@ -552,3 +553,29 @@ export const usePluginServiceGetPluginsSuspense = <
queryFn: () => PluginService.getPlugins({ limit, offset }) as TData,
...options,
});
/**
* Get Dag Stats
* Get Dag statistics.
* @param data The data for the request.
* @param data.dagIds
* @returns DagStatsCollectionResponse Successful Response
* @throws ApiError
*/
export const useDagStatsServiceGetDagStatsSuspense = <
TData = Common.DagStatsServiceGetDagStatsDefaultResponse,
TError = unknown,
TQueryKey extends Array<unknown> = unknown[],
>(
{
dagIds,
}: {
dagIds?: string;
} = {},
queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
) =>
useSuspenseQuery<TData, TError>({
queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }, queryKey),
queryFn: () => DagStatsService.getDagStats({ dagIds }) as TData,
...options,
});
56 changes: 56 additions & 0 deletions airflow/ui/openapi-gen/requests/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1187,6 +1187,62 @@ export const $DagRunType = {
description: "Class with DagRun types.",
} as const;

export const $DagStatsCollectionResponse = {
properties: {
dags: {
items: {
$ref: "#/components/schemas/DagStatsResponse",
},
type: "array",
title: "Dags",
},
total_entries: {
type: "integer",
title: "Total Entries",
},
},
type: "object",
required: ["dags", "total_entries"],
title: "DagStatsCollectionResponse",
description: "DAG Stats Collection serializer for responses.",
} as const;

export const $DagStatsResponse = {
properties: {
dag_id: {
type: "string",
title: "Dag Id",
},
stats: {
items: {
$ref: "#/components/schemas/DagStatsStateResponse",
},
type: "array",
title: "Stats",
},
},
type: "object",
required: ["dag_id", "stats"],
title: "DagStatsResponse",
description: "DAG Stats serializer for responses.",
} as const;

export const $DagStatsStateResponse = {
properties: {
state: {
$ref: "#/components/schemas/DagRunState",
},
count: {
type: "integer",
title: "Count",
},
},
type: "object",
required: ["state", "count"],
title: "DagStatsStateResponse",
description: "DagStatsState serializer for responses.",
} as const;

export const $DagTagPydantic = {
properties: {
name: {
Expand Down
31 changes: 31 additions & 0 deletions airflow/ui/openapi-gen/requests/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import type {
GetProvidersResponse,
GetPluginsData,
GetPluginsResponse,
GetDagStatsData,
GetDagStatsResponse,
} from "./types.gen";

export class AssetService {
Expand Down Expand Up @@ -771,3 +773,32 @@ export class PluginService {
});
}
}

export class DagStatsService {
/**
* Get Dag Stats
* Get Dag statistics.
* @param data The data for the request.
* @param data.dagIds
* @returns DagStatsCollectionResponse Successful Response
* @throws ApiError
*/
public static getDagStats(
data: GetDagStatsData = {},
): CancelablePromise<GetDagStatsResponse> {
return __request(OpenAPI, {
method: "GET",
url: "/public/dagStats/",
query: {
dag_ids: data.dagIds,
},
errors: {
400: "Bad Request",
401: "Unauthorized",
403: "Forbidden",
404: "Not Found",
422: "Unprocessable Entity",
},
});
}
}
Loading

0 comments on commit a3a80ec

Please sign in to comment.