-
Notifications
You must be signed in to change notification settings - Fork 233
fix: tensor equals type raises exception #1739
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
Conversation
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
Signed-off-by: Johannes Messner <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1739 +/- ##
==========================================
+ Coverage 84.45% 84.46% +0.01%
==========================================
Files 134 134
Lines 8840 8840
==========================================
+ Hits 7466 7467 +1
+ Misses 1374 1373 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
) | ||
return any(issubclass(candidate, cls) for candidate in type(instance).mro()) | ||
return any( | ||
issubclass(candidate, cls) for candidate in type(instance).__mro__ |
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.
us safe version of is_subclass please
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.
i am not sure if we want that here. This implements the "normal" isinstance()
call, so i don't think it should work with non-class inputs. For example, the following also raises an exception:
isinstance(3, List[int])
TypeError: Subscripted generics cannot be used with class and instance checks
So I would not catch such things here
Signed-off-by: Johannes Messner <[email protected]>
📝 Docs are deployed on https://ft-fix-tensor-equals-type--jina-docs.netlify.app 🎉 |
Currently the following raises and exception:
This fixes that