Skip to content

Commit

Permalink
Fix main pre-commit (apache#43923)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrejeambrun authored and sunank200 committed Nov 12, 2024
1 parent 4ad7537 commit 2c62dba
Show file tree
Hide file tree
Showing 7 changed files with 410 additions and 0 deletions.
34 changes: 34 additions & 0 deletions airflow/ui/openapi-gen/queries/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
TaskInstanceService,
VariableService,
VersionService,
XcomService,
} from "../requests/services.gen";
import { DagRunState, DagWarningType } from "../requests/types.gen";

Expand Down Expand Up @@ -905,6 +906,39 @@ export const UseDagStatsServiceGetDagStatsKeyFn = (
} = {},
queryKey?: Array<unknown>,
) => [useDagStatsServiceGetDagStatsKey, ...(queryKey ?? [{ dagIds }])];
export type XcomServiceGetXcomEntryDefaultResponse = Awaited<
ReturnType<typeof XcomService.getXcomEntry>
>;
export type XcomServiceGetXcomEntryQueryResult<
TData = XcomServiceGetXcomEntryDefaultResponse,
TError = unknown,
> = UseQueryResult<TData, TError>;
export const useXcomServiceGetXcomEntryKey = "XcomServiceGetXcomEntry";
export const UseXcomServiceGetXcomEntryKeyFn = (
{
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}: {
dagId: string;
dagRunId: string;
deserialize?: boolean;
mapIndex?: number;
stringify?: boolean;
taskId: string;
xcomKey: string;
},
queryKey?: Array<unknown>,
) => [
useXcomServiceGetXcomEntryKey,
...(queryKey ?? [
{ dagId, dagRunId, deserialize, mapIndex, stringify, taskId, xcomKey },
]),
];
export type BackfillServiceCreateBackfillMutationResult = Awaited<
ReturnType<typeof BackfillService.createBackfill>
>;
Expand Down
56 changes: 56 additions & 0 deletions airflow/ui/openapi-gen/queries/prefetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
TaskInstanceService,
VariableService,
VersionService,
XcomService,
} from "../requests/services.gen";
import { DagRunState, DagWarningType } from "../requests/types.gen";
import * as Common from "./common";
Expand Down Expand Up @@ -1214,3 +1215,58 @@ export const prefetchUseDagStatsServiceGetDagStats = (
queryKey: Common.UseDagStatsServiceGetDagStatsKeyFn({ dagIds }),
queryFn: () => DagStatsService.getDagStats({ dagIds }),
});
/**
* Get Xcom Entry
* Get an XCom entry.
* @param data The data for the request.
* @param data.dagId
* @param data.taskId
* @param data.dagRunId
* @param data.xcomKey
* @param data.mapIndex
* @param data.deserialize
* @param data.stringify
* @returns unknown Successful Response
* @throws ApiError
*/
export const prefetchUseXcomServiceGetXcomEntry = (
queryClient: QueryClient,
{
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}: {
dagId: string;
dagRunId: string;
deserialize?: boolean;
mapIndex?: number;
stringify?: boolean;
taskId: string;
xcomKey: string;
},
) =>
queryClient.prefetchQuery({
queryKey: Common.UseXcomServiceGetXcomEntryKeyFn({
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}),
queryFn: () =>
XcomService.getXcomEntry({
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}),
});
57 changes: 57 additions & 0 deletions airflow/ui/openapi-gen/queries/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
TaskInstanceService,
VariableService,
VersionService,
XcomService,
} from "../requests/services.gen";
import {
BackfillPostBody,
Expand Down Expand Up @@ -1464,6 +1465,62 @@ export const useDagStatsServiceGetDagStats = <
queryFn: () => DagStatsService.getDagStats({ dagIds }) as TData,
...options,
});
/**
* Get Xcom Entry
* Get an XCom entry.
* @param data The data for the request.
* @param data.dagId
* @param data.taskId
* @param data.dagRunId
* @param data.xcomKey
* @param data.mapIndex
* @param data.deserialize
* @param data.stringify
* @returns unknown Successful Response
* @throws ApiError
*/
export const useXcomServiceGetXcomEntry = <
TData = Common.XcomServiceGetXcomEntryDefaultResponse,
TError = unknown,
TQueryKey extends Array<unknown> = unknown[],
>(
{
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}: {
dagId: string;
dagRunId: string;
deserialize?: boolean;
mapIndex?: number;
stringify?: boolean;
taskId: string;
xcomKey: string;
},
queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
) =>
useQuery<TData, TError>({
queryKey: Common.UseXcomServiceGetXcomEntryKeyFn(
{ dagId, dagRunId, deserialize, mapIndex, stringify, taskId, xcomKey },
queryKey,
),
queryFn: () =>
XcomService.getXcomEntry({
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}) as TData,
...options,
});
/**
* Create Backfill
* @param data The data for the request.
Expand Down
57 changes: 57 additions & 0 deletions airflow/ui/openapi-gen/queries/suspense.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
TaskInstanceService,
VariableService,
VersionService,
XcomService,
} from "../requests/services.gen";
import { DagRunState, DagWarningType } from "../requests/types.gen";
import * as Common from "./common";
Expand Down Expand Up @@ -1449,3 +1450,59 @@ export const useDagStatsServiceGetDagStatsSuspense = <
queryFn: () => DagStatsService.getDagStats({ dagIds }) as TData,
...options,
});
/**
* Get Xcom Entry
* Get an XCom entry.
* @param data The data for the request.
* @param data.dagId
* @param data.taskId
* @param data.dagRunId
* @param data.xcomKey
* @param data.mapIndex
* @param data.deserialize
* @param data.stringify
* @returns unknown Successful Response
* @throws ApiError
*/
export const useXcomServiceGetXcomEntrySuspense = <
TData = Common.XcomServiceGetXcomEntryDefaultResponse,
TError = unknown,
TQueryKey extends Array<unknown> = unknown[],
>(
{
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}: {
dagId: string;
dagRunId: string;
deserialize?: boolean;
mapIndex?: number;
stringify?: boolean;
taskId: string;
xcomKey: string;
},
queryKey?: TQueryKey,
options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
) =>
useSuspenseQuery<TData, TError>({
queryKey: Common.UseXcomServiceGetXcomEntryKeyFn(
{ dagId, dagRunId, deserialize, mapIndex, stringify, taskId, xcomKey },
queryKey,
),
queryFn: () =>
XcomService.getXcomEntry({
dagId,
dagRunId,
deserialize,
mapIndex,
stringify,
taskId,
xcomKey,
}) as TData,
...options,
});
92 changes: 92 additions & 0 deletions airflow/ui/openapi-gen/requests/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3096,3 +3096,95 @@ export const $VersionInfo = {
title: "VersionInfo",
description: "Version information serializer for responses.",
} as const;

export const $XComResponseNative = {
properties: {
key: {
type: "string",
title: "Key",
},
timestamp: {
type: "string",
format: "date-time",
title: "Timestamp",
},
execution_date: {
type: "string",
format: "date-time",
title: "Execution Date",
},
map_index: {
type: "integer",
title: "Map Index",
},
task_id: {
type: "string",
title: "Task Id",
},
dag_id: {
type: "string",
title: "Dag Id",
},
value: {
title: "Value",
},
},
type: "object",
required: [
"key",
"timestamp",
"execution_date",
"map_index",
"task_id",
"dag_id",
"value",
],
title: "XComResponseNative",
description: "XCom response serializer with native return type.",
} as const;

export const $XComResponseString = {
properties: {
key: {
type: "string",
title: "Key",
},
timestamp: {
type: "string",
format: "date-time",
title: "Timestamp",
},
execution_date: {
type: "string",
format: "date-time",
title: "Execution Date",
},
map_index: {
type: "integer",
title: "Map Index",
},
task_id: {
type: "string",
title: "Task Id",
},
dag_id: {
type: "string",
title: "Dag Id",
},
value: {
title: "Value",
},
},
type: "object",
required: [
"key",
"timestamp",
"execution_date",
"map_index",
"task_id",
"dag_id",
"value",
],
title: "XComResponseString",
description: "XCom response serializer with string return type.",
} as const;
Loading

0 comments on commit 2c62dba

Please sign in to comment.