This is an automated email from the ASF dual-hosted git repository.

pierrejeambrun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9285cc7b1d2 AIP-84 Fix dag reports tests outside of breeze (#46125)
9285cc7b1d2 is described below

commit 9285cc7b1d252a7cc4189b7b8e3022c4c67e3fc2
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Mon Jan 27 13:39:38 2025 +0100

    AIP-84 Fix dag reports tests outside of breeze (#46125)
---
 airflow/api_fastapi/core_api/openapi/v1-generated.yaml     |  4 ++--
 airflow/api_fastapi/core_api/routes/public/dag_report.py   |  2 +-
 airflow/ui/openapi-gen/queries/common.ts                   | 14 +++++++-------
 airflow/ui/openapi-gen/queries/prefetch.ts                 |  8 ++++----
 airflow/ui/openapi-gen/queries/queries.ts                  | 10 +++++-----
 airflow/ui/openapi-gen/queries/suspense.ts                 | 10 +++++-----
 airflow/ui/openapi-gen/requests/services.gen.ts            |  8 ++++----
 airflow/ui/openapi-gen/requests/types.gen.ts               |  6 +++---
 .../api_fastapi/core_api/routes/public/test_dag_report.py  |  4 +++-
 9 files changed, 34 insertions(+), 32 deletions(-)

diff --git a/airflow/api_fastapi/core_api/openapi/v1-generated.yaml 
b/airflow/api_fastapi/core_api/openapi/v1-generated.yaml
index 4b878191cc1..b40538e0244 100644
--- a/airflow/api_fastapi/core_api/openapi/v1-generated.yaml
+++ b/airflow/api_fastapi/core_api/openapi/v1-generated.yaml
@@ -2590,9 +2590,9 @@ paths:
     get:
       tags:
       - DagReport
-      summary: Get Dag Report
+      summary: Get Dag Reports
       description: Get DAG report.
-      operationId: get_dag_report
+      operationId: get_dag_reports
       parameters:
       - name: subdir
         in: query
diff --git a/airflow/api_fastapi/core_api/routes/public/dag_report.py 
b/airflow/api_fastapi/core_api/routes/public/dag_report.py
index 03dfd5aad9e..095be7135b2 100644
--- a/airflow/api_fastapi/core_api/routes/public/dag_report.py
+++ b/airflow/api_fastapi/core_api/routes/public/dag_report.py
@@ -42,7 +42,7 @@ dag_report_router = AirflowRouter(tags=["DagReport"], 
prefix="/dagReports")
         ]
     ),
 )
-def get_dag_report(
+def get_dag_reports(
     subdir: str,
 ):
     """Get DAG report."""
diff --git a/airflow/ui/openapi-gen/queries/common.ts 
b/airflow/ui/openapi-gen/queries/common.ts
index 9559f009c08..73236c9b2d6 100644
--- a/airflow/ui/openapi-gen/queries/common.ts
+++ b/airflow/ui/openapi-gen/queries/common.ts
@@ -651,22 +651,22 @@ export const UseDagStatsServiceGetDagStatsKeyFn = (
   } = {},
   queryKey?: Array<unknown>,
 ) => [useDagStatsServiceGetDagStatsKey, ...(queryKey ?? [{ dagIds }])];
-export type DagReportServiceGetDagReportDefaultResponse = Awaited<
-  ReturnType<typeof DagReportService.getDagReport>
+export type DagReportServiceGetDagReportsDefaultResponse = Awaited<
+  ReturnType<typeof DagReportService.getDagReports>
 >;
-export type DagReportServiceGetDagReportQueryResult<
-  TData = DagReportServiceGetDagReportDefaultResponse,
+export type DagReportServiceGetDagReportsQueryResult<
+  TData = DagReportServiceGetDagReportsDefaultResponse,
   TError = unknown,
 > = UseQueryResult<TData, TError>;
-export const useDagReportServiceGetDagReportKey = 
"DagReportServiceGetDagReport";
-export const UseDagReportServiceGetDagReportKeyFn = (
+export const useDagReportServiceGetDagReportsKey = 
"DagReportServiceGetDagReports";
+export const UseDagReportServiceGetDagReportsKeyFn = (
   {
     subdir,
   }: {
     subdir: string;
   },
   queryKey?: Array<unknown>,
-) => [useDagReportServiceGetDagReportKey, ...(queryKey ?? [{ subdir }])];
+) => [useDagReportServiceGetDagReportsKey, ...(queryKey ?? [{ subdir }])];
 export type DagWarningServiceListDagWarningsDefaultResponse = Awaited<
   ReturnType<typeof DagWarningService.listDagWarnings>
 >;
diff --git a/airflow/ui/openapi-gen/queries/prefetch.ts 
b/airflow/ui/openapi-gen/queries/prefetch.ts
index 2718e0d19e4..63a949aca94 100644
--- a/airflow/ui/openapi-gen/queries/prefetch.ts
+++ b/airflow/ui/openapi-gen/queries/prefetch.ts
@@ -889,14 +889,14 @@ export const prefetchUseDagStatsServiceGetDagStats = (
     queryFn: () => DagStatsService.getDagStats({ dagIds }),
   });
 /**
- * Get Dag Report
+ * Get Dag Reports
  * Get DAG report.
  * @param data The data for the request.
  * @param data.subdir
  * @returns unknown Successful Response
  * @throws ApiError
  */
-export const prefetchUseDagReportServiceGetDagReport = (
+export const prefetchUseDagReportServiceGetDagReports = (
   queryClient: QueryClient,
   {
     subdir,
@@ -905,8 +905,8 @@ export const prefetchUseDagReportServiceGetDagReport = (
   },
 ) =>
   queryClient.prefetchQuery({
-    queryKey: Common.UseDagReportServiceGetDagReportKeyFn({ subdir }),
-    queryFn: () => DagReportService.getDagReport({ subdir }),
+    queryKey: Common.UseDagReportServiceGetDagReportsKeyFn({ subdir }),
+    queryFn: () => DagReportService.getDagReports({ subdir }),
   });
 /**
  * List Dag Warnings
diff --git a/airflow/ui/openapi-gen/queries/queries.ts 
b/airflow/ui/openapi-gen/queries/queries.ts
index af43979e0ea..0fe9e425b70 100644
--- a/airflow/ui/openapi-gen/queries/queries.ts
+++ b/airflow/ui/openapi-gen/queries/queries.ts
@@ -1077,15 +1077,15 @@ export const useDagStatsServiceGetDagStats = <
     ...options,
   });
 /**
- * Get Dag Report
+ * Get Dag Reports
  * Get DAG report.
  * @param data The data for the request.
  * @param data.subdir
  * @returns unknown Successful Response
  * @throws ApiError
  */
-export const useDagReportServiceGetDagReport = <
-  TData = Common.DagReportServiceGetDagReportDefaultResponse,
+export const useDagReportServiceGetDagReports = <
+  TData = Common.DagReportServiceGetDagReportsDefaultResponse,
   TError = unknown,
   TQueryKey extends Array<unknown> = unknown[],
 >(
@@ -1098,8 +1098,8 @@ export const useDagReportServiceGetDagReport = <
   options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
 ) =>
   useQuery<TData, TError>({
-    queryKey: Common.UseDagReportServiceGetDagReportKeyFn({ subdir }, 
queryKey),
-    queryFn: () => DagReportService.getDagReport({ subdir }) as TData,
+    queryKey: Common.UseDagReportServiceGetDagReportsKeyFn({ subdir }, 
queryKey),
+    queryFn: () => DagReportService.getDagReports({ subdir }) as TData,
     ...options,
   });
 /**
diff --git a/airflow/ui/openapi-gen/queries/suspense.ts 
b/airflow/ui/openapi-gen/queries/suspense.ts
index fbc653515f8..d2f3bfc937c 100644
--- a/airflow/ui/openapi-gen/queries/suspense.ts
+++ b/airflow/ui/openapi-gen/queries/suspense.ts
@@ -1056,15 +1056,15 @@ export const useDagStatsServiceGetDagStatsSuspense = <
     ...options,
   });
 /**
- * Get Dag Report
+ * Get Dag Reports
  * Get DAG report.
  * @param data The data for the request.
  * @param data.subdir
  * @returns unknown Successful Response
  * @throws ApiError
  */
-export const useDagReportServiceGetDagReportSuspense = <
-  TData = Common.DagReportServiceGetDagReportDefaultResponse,
+export const useDagReportServiceGetDagReportsSuspense = <
+  TData = Common.DagReportServiceGetDagReportsDefaultResponse,
   TError = unknown,
   TQueryKey extends Array<unknown> = unknown[],
 >(
@@ -1077,8 +1077,8 @@ export const useDagReportServiceGetDagReportSuspense = <
   options?: Omit<UseQueryOptions<TData, TError>, "queryKey" | "queryFn">,
 ) =>
   useSuspenseQuery<TData, TError>({
-    queryKey: Common.UseDagReportServiceGetDagReportKeyFn({ subdir }, 
queryKey),
-    queryFn: () => DagReportService.getDagReport({ subdir }) as TData,
+    queryKey: Common.UseDagReportServiceGetDagReportsKeyFn({ subdir }, 
queryKey),
+    queryFn: () => DagReportService.getDagReports({ subdir }) as TData,
     ...options,
   });
 /**
diff --git a/airflow/ui/openapi-gen/requests/services.gen.ts 
b/airflow/ui/openapi-gen/requests/services.gen.ts
index 9a22483f682..91edabfc3dc 100644
--- a/airflow/ui/openapi-gen/requests/services.gen.ts
+++ b/airflow/ui/openapi-gen/requests/services.gen.ts
@@ -93,8 +93,8 @@ import type {
   GetDagSourceResponse,
   GetDagStatsData,
   GetDagStatsResponse,
-  GetDagReportData,
-  GetDagReportResponse,
+  GetDagReportsData,
+  GetDagReportsResponse,
   ListDagWarningsData,
   ListDagWarningsResponse,
   GetDagsData,
@@ -1524,14 +1524,14 @@ export class DagStatsService {
 
 export class DagReportService {
   /**
-   * Get Dag Report
+   * Get Dag Reports
    * Get DAG report.
    * @param data The data for the request.
    * @param data.subdir
    * @returns unknown Successful Response
    * @throws ApiError
    */
-  public static getDagReport(data: GetDagReportData): 
CancelablePromise<GetDagReportResponse> {
+  public static getDagReports(data: GetDagReportsData): 
CancelablePromise<GetDagReportsResponse> {
     return __request(OpenAPI, {
       method: "GET",
       url: "/public/dagReports",
diff --git a/airflow/ui/openapi-gen/requests/types.gen.ts 
b/airflow/ui/openapi-gen/requests/types.gen.ts
index 4e518a81aad..cf1cacdf115 100644
--- a/airflow/ui/openapi-gen/requests/types.gen.ts
+++ b/airflow/ui/openapi-gen/requests/types.gen.ts
@@ -1877,11 +1877,11 @@ export type GetDagStatsData = {
 
 export type GetDagStatsResponse = DagStatsCollectionResponse;
 
-export type GetDagReportData = {
+export type GetDagReportsData = {
   subdir: string;
 };
 
-export type GetDagReportResponse = unknown;
+export type GetDagReportsResponse = unknown;
 
 export type ListDagWarningsData = {
   dagId?: string | null;
@@ -3551,7 +3551,7 @@ export type $OpenApiTs = {
   };
   "/public/dagReports": {
     get: {
-      req: GetDagReportData;
+      req: GetDagReportsData;
       res: {
         /**
          * Successful Response
diff --git a/tests/api_fastapi/core_api/routes/public/test_dag_report.py 
b/tests/api_fastapi/core_api/routes/public/test_dag_report.py
index 4a72d16c2df..c5eae24703d 100644
--- a/tests/api_fastapi/core_api/routes/public/test_dag_report.py
+++ b/tests/api_fastapi/core_api/routes/public/test_dag_report.py
@@ -35,8 +35,10 @@ TEST_DAG_FOLDER_INVALID_2 = "/root/airflow/tests/dags/"
 
 
 def get_corresponding_dag_file_count(dir: str, include_examples: bool = True) 
-> int:
+    from airflow import example_dags
+
     return len(list_py_file_paths(directory=dir)) + (
-        len(list_py_file_paths("/opt/airflow/airflow/example_dags")) if 
include_examples else 0
+        len(list_py_file_paths(next(iter(example_dags.__path__)))) if 
include_examples else 0
     )
 
 

Reply via email to