This repository has been archived by the owner on Aug 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
We just fallback to `typing.Any` and make an explicit type-cast, instead of resolving the generic type argument at runtime to automatically get the reference to `uuid_subtype_func`. Here is the story: Currently Python does not allow introspection of generic type arguments in runtime. For some limited cases, we could refer `__orig_bases__`, but somehow it does not work for us and it is a known limitation that we cann t resolve it early in the object lifecycle. (ref: https://stackoverflow.com/questions/57706180, python/typing#658) Moreover, SQLAlchemy's `TypeDecorator` also involves its own metaclass logic from `TraversibleType`, which makes `__orig_class__` unavailable.
Codecov Report
@@ Coverage Diff @@
## main #508 +/- ##
==========================================
+ Coverage 48.83% 48.87% +0.03%
==========================================
Files 54 54
Lines 8951 8952 +1
==========================================
+ Hits 4371 4375 +4
+ Misses 4580 4577 -3
Continue to review full report at Codecov.
|
achimnol
added a commit
that referenced
this pull request
Dec 27, 2021
* setup: Set the minimum mypy version to 0.930 * fix: New typecheck errors due to stricter enum validation * fix: Workaround limitation of type variable usage in ClassVar We just fallback to `typing.Any` and make an explicit type-cast, instead of resolving the generic type argument at runtime to automatically get the reference to `uuid_subtype_func`. Here is the story: Currently Python does not allow introspection of generic type arguments in runtime. For some limited cases, we could refer `__orig_bases__`, but somehow it does not work for us and it is a known limitation that we cann t resolve it early in the object lifecycle. (ref: https://stackoverflow.com/questions/57706180, python/typing#658) Moreover, SQLAlchemy's `TypeDecorator` also involves its own metaclass logic from `TraversibleType`, which makes `__orig_class__` unavailable. Backported-From: main (22.03) Backported-To: 21.09
achimnol
added a commit
that referenced
this pull request
Dec 27, 2021
* setup: Set the minimum mypy version to 0.930 * fix: New typecheck errors due to stricter enum validation * fix: Workaround limitation of type variable usage in ClassVar We just fallback to `typing.Any` and make an explicit type-cast, instead of resolving the generic type argument at runtime to automatically get the reference to `uuid_subtype_func`. Here is the story: Currently Python does not allow introspection of generic type arguments in runtime. For some limited cases, we could refer `__orig_bases__`, but somehow it does not work for us and it is a known limitation that we cann t resolve it early in the object lifecycle. (ref: https://stackoverflow.com/questions/57706180, python/typing#658) Moreover, SQLAlchemy's `TypeDecorator` also involves its own metaclass logic from `TraversibleType`, which makes `__orig_class__` unavailable. Backported-From: main (22.03) Backported-To: 21.03
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes new typecheck errors found by mypy 0.930 update.