bugraoz93 commented on code in PR #49164:
URL: https://github.com/apache/airflow/pull/49164#discussion_r2106239359
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/assets.py:
##########
@@ -341,7 +341,12 @@ def create_asset_event(
@assets_router.post(
"/assets/{asset_id}/materialize",
- responses=create_openapi_http_exception_doc([status.HTTP_404_NOT_FOUND,
status.HTTP_409_CONFLICT]),
+ responses=create_openapi_http_exception_doc(
+ [
+ status.HTTP_404_NOT_FOUND,
+ status.HTTP_409_CONFLICT,
+ ]
Review Comment:
```suggestion
[
status.HTTP_404_NOT_FOUND,
status.HTTP_409_CONFLICT,
status.HTTP_400_BAD_REQUEST
]
```
Since `DeserializationError` throws 400, we should document it, similar to
below
https://github.com/apache/airflow/blob/beb7b629161c0e51f7995ee630ec53820a41b6f0/airflow-core/src/airflow/api_fastapi/core_api/routes/public/xcom.py#L55
This comment applies to all of the endpoint throws 400 added in this PR.
##########
airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dags.py:
##########
@@ -624,3 +628,30 @@ def test_delete_dag_should_response_401(self,
unauthenticated_test_client):
def test_delete_dag_should_response_403(self, unauthorized_test_client):
response = unauthorized_test_client.delete(f"{API_PREFIX}/{DAG1_ID}")
assert response.status_code == 403
+
+
+def test_get_dag_with_deserialization_error(monkeypatch):
Review Comment:
It would be excellent to include this case for all the endpoints we have
updated with the new exception 400.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]