pierrejeambrun commented on code in PR #42508:
URL: https://github.com/apache/airflow/pull/42508#discussion_r1777373066
##########
airflow/api_fastapi/views/public/dags.py:
##########
@@ -71,16 +72,13 @@ async def get_dags(
dags = session.scalars(dags_query).all()
- try:
- return DAGCollectionResponse(
- dags=[DAGResponse.model_validate(dag, from_attributes=True) for
dag in dags],
- total_entries=total_entries,
- )
- except ValueError as e:
- raise HTTPException(400, f"DAGCollectionSchema error: {str(e)}")
+ return DAGCollectionResponse(
+ dags=[DAGResponse.model_validate(dag, from_attributes=True) for dag in
dags],
+ total_entries=total_entries,
+ )
-@dags_router.patch("/dags/{dag_id}")
+@dags_router.patch("/dags/{dag_id}",
responses=create_openapi_http_exception_doc([400, 401, 403, 404]))
Review Comment:
This is how we tell FastAPI the possible error code returned by the endpoint
--
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]