Skip to content

Conversation

@jscheffl
Copy link
Contributor

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.

@boring-cyborg boring-cyborg bot added the area:API Airflow's REST/HTTP API label Oct 12, 2025
@jscheffl jscheffl added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Oct 12, 2025
Copy link
Member

@jason810496 jason810496 left a 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!

except ValueError:
raise HTTPException(
status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
status_code=status.HTTP_422_UNPROCESSABLE_CONTENT,
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor

@amoghrajesh amoghrajesh left a 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

Copy link
Member

@pierrejeambrun pierrejeambrun left a 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

@kaxil kaxil added this to the Airflow 3.1.1 milestone Oct 14, 2025
@amoghrajesh amoghrajesh linked an issue Oct 18, 2025 that may be closed by this pull request
2 tasks
@kaxil kaxil modified the milestones: Airflow 3.1.1, Airflow 3.1.2 Oct 21, 2025
@jscheffl jscheffl closed this Oct 26, 2025
@kaxil kaxil removed this from the Airflow 3.1.2 milestone Oct 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix HTTP_422_UNPROCESSABLE_ENTITY deprecation

6 participants