fix: DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE#693
fix: DeprecationWarning on HTTP_413_REQUEST_ENTITY_TOO_LARGE#693SrzStephen wants to merge 1 commit intoa2aproject:mainfrom
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!
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.