Refactor imports to use FastAPI modules instead of Starlette#58127
Refactor imports to use FastAPI modules instead of Starlette#58127chiuinggum wants to merge 2 commits intoapache:mainfrom
Conversation
sunank200
left a comment
There was a problem hiding this comment.
Many tests are failing
| 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.
IIRC someone tried this before and it didn’t work
There was a problem hiding this comment.
This can use airflow.api_fastapi.compat.HTTP_422_UNPROCESSABLE_CONTENT instead now.
|
Are the imports considered equivalent? We should have some references from FastAPI for the import changes. |
pierrejeambrun
left a comment
There was a problem hiding this comment.
Yes, for some utility functions and classes, FastAPI just re-export the 'starlette' entities for convenience.
I think it's indeed better to use things from FastAPI instead whenever possible.
As long as the CI is happy i'm good with that.
Do you ming fixing the CI please?
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
|
@chiuinggum Any chance you can address rebase the PR and fix the CI ? |
|
Closing in favor of #60382 that was merged. |
Why
Note
After this change, the remaining from

starletteimports are limited to the following^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.