-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Router refactor #1043
Router refactor #1043
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
CodSpeed Performance ReportMerging #1043 will not alter performanceComparing Summary
|
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.
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!
Description
This PR fixes #1044 builds on the earlier "Fix mypy warnings in router.py" #1038
Summary
This PR refactors
def _format_response(self, res: Union[Dict, Response, bytes, tuple, str]) -> Response
to reduce nesting and remove the two complicated formats to other functions_format_dict_response
and_format_tuple_response
All tests pass (but I want to add unit tests to confirm more examples without needing a running server).
This should resolve these comments from @sansyrox : #1038 (comment) and #1038 (comment)
PR Checklist
Please ensure that:
Pre-Commit Instructions: