-
Notifications
You must be signed in to change notification settings - Fork 297
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
Fix mypy errors caught in 1.11.2 #2808
Conversation
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
…mmit-hooks Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
def convert_marshmallow_json_schema_to_python_class( | ||
schema: dict, schema_name: typing.Any | ||
) -> Type[dataclasses.dataclass()]: # type: ignore | ||
def convert_marshmallow_json_schema_to_python_class(schema: dict, schema_name: typing.Any) -> type: |
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.
python/cpython#102699 is a discussion about having a baseclass for dataclasses that could be used here instead of Type[dataclasses.dataclass()]
which is invalid. Unfortunately that is just a proposal for now.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2808 +/- ##
===========================================
- Coverage 76.82% 51.15% -25.67%
===========================================
Files 196 302 +106
Lines 20301 25341 +5040
Branches 2610 2613 +3
===========================================
- Hits 15596 12964 -2632
- Misses 4004 12270 +8266
+ Partials 701 107 -594 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Why are the changes needed?
mypy 1.11.2 catches new errors in flytekit:
What changes were proposed in this pull request?
This PR fixes the new errors and opportunistically updates the version of ruff in precommit.
Notice that these types added to handle dataclasses only paper over the problem. We have some code that doesn't make any sense in the python type system, for example
flytekit/flytekit/core/type_engine.py
Line 2197 in d22e8a8
How was this patch tested?
Setup process
Screenshots
Check all the applicable boxes
Related PRs
Docs link