Open dave42w opened 4 days ago
The latest updates on your projects. Learn more about Vercel for Git βοΈ
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
robyn | β Ready (Inspect) | Visit Preview | π¬ Add feedback | Nov 20, 2024 10:46pm |
Comparing dave42w:mypy
(989a0ef) with main
(3f2e79a)
β
146
untouched benchmarks
Hey @dave42w π
What python version are you using?
Hey @dave42w π
What python version are you using?
Python 3.12.7 and mypy 1.13.0
@sansyrox Are we ok to merge?
Description
This PR fixes mypy issues in openapi.py
Summary
This PR fixes the following
TypedDict
all
TypedDict
replaced withdict
the python docs don't include any examples of using TypedDict for a variable, only as a class. mypy 1.13.0 complains about examples like thisquery_params: Optional[TypedDict],
so I have changed them all to be likequery_params: Optional[Dict],
All tests still passMyPy error:
Variable "typing.TypedDict" is not valid as a type
This meant changing a few tests from
to
While the tests all pass I'm not sure if the logic of typing.get_type_hints still works for Dict vs TypedDict
missing dict type
def get_path_obj variable openapi_path_object
This wasn't given a type which was causing multiple mypy errors:
all fixed by changing the declaration to:
def get_schema_object local variable properties
same as above. Change declaration to
all the similar warnings are gone
my results
These changes mean that mypy 1.13 finds no warnings in openapi.py
PR Checklist
Please ensure that:
Pre-Commit Instructions: