pierrejeambrun commented on code in PR #58828:
URL: https://github.com/apache/airflow/pull/58828#discussion_r2576604239
##########
airflow-core/src/airflow/api_fastapi/common/parameters.py:
##########
@@ -32,12 +32,19 @@
overload,
)
-from fastapi import Depends, HTTPException, Query, status
+from fastapi import Depends, HTTPException, Query
from pendulum.parsing.exceptions import ParserError
from pydantic import AfterValidator, BaseModel, NonNegativeInt
from sqlalchemy import Column, and_, case, func, not_, or_, select as
sql_select
from sqlalchemy.inspection import inspect
+try:
+ from starlette.status import HTTP_422_UNPROCESSABLE_CONTENT
+except ImportError:
+ from starlette.status import ( # type: ignore[no-redef]
+ HTTP_422_UNPROCESSABLE_ENTITY as HTTP_422_UNPROCESSABLE_CONTENT,
+ )
+
Review Comment:
Nit:
Maybe put that into a common file and import from there, so we do not forget
to duplicate this piece of code everytime we need the 422 status.
--
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]