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

kaxilnaik 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 f3bad1e9e17 AIP-84 Clean status code (#44134)
f3bad1e9e17 is described below

commit f3bad1e9e173565e035e5c3d2a47eb8a0cb0de97
Author: Pierre Jeambrun <[email protected]>
AuthorDate: Mon Nov 18 19:59:04 2024 +0800

    AIP-84 Clean status code (#44134)
---
 .../core_api/routes/public/connections.py            |  6 ------
 .../api_fastapi/core_api/routes/public/event_logs.py |  1 -
 airflow/api_fastapi/core_api/routes/public/pools.py  |  4 +---
 .../core_api/routes/public/task_instances.py         | 20 +++++---------------
 4 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/airflow/api_fastapi/core_api/routes/public/connections.py 
b/airflow/api_fastapi/core_api/routes/public/connections.py
index f1e71eb0f48..406d689d5e9 100644
--- a/airflow/api_fastapi/core_api/routes/public/connections.py
+++ b/airflow/api_fastapi/core_api/routes/public/connections.py
@@ -180,12 +180,6 @@ def patch_connection(
 
 @connections_router.post(
     "/test",
-    responses=create_openapi_http_exception_doc(
-        [
-            status.HTTP_401_UNAUTHORIZED,
-            status.HTTP_403_FORBIDDEN,
-        ]
-    ),
 )
 def test_connection(
     test_body: ConnectionBody,
diff --git a/airflow/api_fastapi/core_api/routes/public/event_logs.py 
b/airflow/api_fastapi/core_api/routes/public/event_logs.py
index 6405c177a39..1a0e7fad2f6 100644
--- a/airflow/api_fastapi/core_api/routes/public/event_logs.py
+++ b/airflow/api_fastapi/core_api/routes/public/event_logs.py
@@ -62,7 +62,6 @@ def get_event_log(
 
 @event_logs_router.get(
     "/",
-    responses=create_openapi_http_exception_doc([status.HTTP_401_UNAUTHORIZED, 
status.HTTP_403_FORBIDDEN]),
 )
 def get_event_logs(
     limit: QueryLimit,
diff --git a/airflow/api_fastapi/core_api/routes/public/pools.py 
b/airflow/api_fastapi/core_api/routes/public/pools.py
index 07ed0f6a0b5..b3874347b41 100644
--- a/airflow/api_fastapi/core_api/routes/public/pools.py
+++ b/airflow/api_fastapi/core_api/routes/public/pools.py
@@ -66,9 +66,7 @@ def delete_pool(
 
 @pools_router.get(
     "/{pool_name}",
-    responses=create_openapi_http_exception_doc(
-        [status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN, 
status.HTTP_404_NOT_FOUND]
-    ),
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
 )
 def get_pool(
     pool_name: str,
diff --git a/airflow/api_fastapi/core_api/routes/public/task_instances.py 
b/airflow/api_fastapi/core_api/routes/public/task_instances.py
index 271f75e69e6..c805095f582 100644
--- a/airflow/api_fastapi/core_api/routes/public/task_instances.py
+++ b/airflow/api_fastapi/core_api/routes/public/task_instances.py
@@ -97,9 +97,7 @@ def get_task_instance(
 
 @task_instances_router.get(
     "/{task_id}/listMapped",
-    responses=create_openapi_http_exception_doc(
-        [status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN, 
status.HTTP_404_NOT_FOUND]
-    ),
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
 )
 def get_mapped_task_instances(
     dag_id: str,
@@ -182,15 +180,11 @@ def get_mapped_task_instances(
 
 @task_instances_router.get(
     "/{task_id}/dependencies",
-    responses=create_openapi_http_exception_doc(
-        [status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN, 
status.HTTP_404_NOT_FOUND]
-    ),
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
 )
 @task_instances_router.get(
     "/{task_id}/{map_index}/dependencies",
-    responses=create_openapi_http_exception_doc(
-        [status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN, 
status.HTTP_404_NOT_FOUND]
-    ),
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
 )
 def get_task_instance_dependencies(
     dag_id: str,
@@ -240,9 +234,7 @@ def get_task_instance_dependencies(
 
 @task_instances_router.get(
     "/{task_id}/{map_index}",
-    responses=create_openapi_http_exception_doc(
-        [status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN, 
status.HTTP_404_NOT_FOUND]
-    ),
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
 )
 def get_mapped_task_instance(
     dag_id: str,
@@ -271,9 +263,7 @@ def get_mapped_task_instance(
 
 @task_instances_router.get(
     "/",
-    responses=create_openapi_http_exception_doc(
-        [status.HTTP_401_UNAUTHORIZED, status.HTTP_403_FORBIDDEN, 
status.HTTP_404_NOT_FOUND]
-    ),
+    responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND]),
 )
 def get_task_instances(
     dag_id: str,

Reply via email to