-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Update FastAPI Deprecations from HTTP error code 422 handling #56564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update FastAPI Deprecations from HTTP error code 422 handling #56564
Conversation
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix!
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dags.py
Outdated
Show resolved
Hide resolved
| except ValueError: | ||
| raise HTTPException( | ||
| status_code=status.HTTP_422_UNPROCESSABLE_ENTITY, | ||
| status_code=status.HTTP_422_UNPROCESSABLE_CONTENT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to bump the min FastAPI version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It awfully looks like that from the error wiht lowest deps. But likely it's starlette that should be bumped.
FAILED airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_dag_run.py::TestGetDagRuns::test_invalid_state - AttributeError: module 'starlette.status' has no attribute 'HTTP_422_UNPROCESSABLE_CONTENT'. Did you mean: 'HTTP_422_UNPROCESSABLE_ENTITY'?
FAILED airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_task_instances.py::TestGetTaskInstances::test_bad_state - AttributeError: module 'starlette.status' has no attribute 'HTTP_422_UNPROCESSABLE_CONTENT'. Did you mean: 'HTTP_422_UNPROCESSABLE_ENTITY'?
================================================================== 2 failed, 1940 p
Yep. Added in 0.48.0 so we need to >=0.48.0 on starlette.
amoghrajesh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except for the fastapi bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, approved with the starlette bump
Fix deprecation warning:
airflow-core/src/airflow/api_fastapi/execution_api/routes/__init__.py:23 DeprecationWarning: 'HTTP_422_UNPROCESSABLE_ENTITY' is deprecated. Use 'HTTP_422_UNPROCESSABLE_CONTENT' instead.