fix(deps): DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE#693
Conversation
…. Use 'HTTP_413_CONTENT_TOO_LARGE' instead. Reason for this is that in Kludex/starlette@40a8147 they changed the enum to match https://www.rfc-editor.org/rfc/rfc9110#name-413-content-too-large starlette release specifier due to this only being changed in https://github.com/Kludex/starlette/releases/tag/0.48.0
Summary of ChangesHello @SrzStephen, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves a DeprecationWarning originating from a change in Starlette's HTTP status code enumeration. By updating the reference from HTTP_413_REQUEST_ENTITY_TOO_LARGE to HTTP_413_CONTENT_TOO_LARGE and specifying a minimum Starlette version, the project maintains compatibility with recent Starlette releases and adheres to updated RFC standards, preventing future warnings and potential breakage. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses the DeprecationWarning from starlette by replacing HTTP_413_REQUEST_ENTITY_TOO_LARGE with the new HTTP_413_CONTENT_TOO_LARGE constant. The changes are applied consistently across all relevant files, and the dependency version in pyproject.toml and uv.lock has been updated accordingly to ensure compatibility. The fix is well-contained and follows best practices. Great work!
holtskinner
left a comment
There was a problem hiding this comment.
We're intentionally not requiring a minimum starlette version, instead we're requiring a minimum fastapi version.
Can you modify this change to work with both starlette statuses?
Don't lock starlette version
Name "HTTP_413_CONTENT_TOO_LARGE" already defined (possibly by an import) [no-redef]
DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE
|
@gemini-code-assist review |
DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGEDeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE
There was a problem hiding this comment.
Code Review
The pull request addresses a DeprecationWarning in Starlette by conditionally importing HTTP_413_CONTENT_TOO_LARGE or aliasing HTTP_413_REQUEST_ENTITY_TOO_LARGE for backward compatibility. This is a good approach to handle API changes in external libraries while maintaining compatibility with older versions. The changes are well-contained and directly address the reported issue.
🤖 I have created a release *beep* *boop* --- ## [0.3.24](v0.3.23...v0.3.24) (2026-02-20) ### Bug Fixes * **core:** preserve legitimate falsy values in _clean_empty ([#713](#713)) ([7632f55](7632f55)) * **deps:** `DeprecationWarning` on `HTTP_413_REQUEST_ENTITY_TOO_LARGE` ([#693](#693)) ([9968f9c](9968f9c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Description
In This commit that landed in v0.48.0 starlette changed constants to conform to RFC9110.
It's the only one affected that I could find in this codebase.
CONTRIBUTINGGuide.fix:which represents bug fixes, and correlates to a SemVer patch.feat:represents a new feature, and correlates to a SemVer minor.feat!:, orfix!:,refactor!:, etc., which represent a breaking change (indicated by the!) and will result in a SemVer major.bash scripts/format.shfrom the repository root to format)Tests
Before and after: confirmed that this is fixed.
uv run python -W error::DeprecationWarning -c "from a2a.server.apps.jsonrpc.fastapi_app import *"Confirmed that tests worked with
Other
uv.lock currently has
So I don't think the dependency pinning is a breaking change.