-
Notifications
You must be signed in to change notification settings - Fork 89
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: using numba.core.errors.Numba<Error>
instead of Error
in a Numba typing context.
#2659
Conversation
Codecov Report
Additional details and impacted files
|
From the deprecation notice,, it seems to me that we should be using the Numba-aliased errors. I replaced our changes to I also therefore am mixing import styles, but I think in time we are moving to |
numba.core.errors.Numba<Error>
instead of Error
in a Numba typing context.
I'm not really sure what the intended difference is between >>> issubclass(numba.TypingError, numba.NumbaError)
True
>>> issubclass(numba.NumbaTypeError, numba.NumbaError)
True Oh, it turns out that >>> numba.TypingError.mro()
[<class 'numba.core.errors.TypingError'>, <class 'numba.core.errors.NumbaError'>, <class 'Exception'>, <class 'BaseException'>, <class 'object'>]
>>> numba.NumbaTypeError.mro()
[<class 'numba.core.errors.NumbaTypeError'>, <class 'numba.core.errors.TypingError'>, <class 'numba.core.errors.NumbaError'>, <class 'Exception'>, <class 'BaseException'>, <class 'object'>] I'm on board with @ianna, what do you think? |
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 like it, it is more expressive. Thanks!
Okay, then I'll merge! |
This is the only update needed to pass tests with Numba 0.58.0rc1. However, that version of Numba still raises a warning if
export NUMBA_CAPTURED_ERRORS=new_style
is not explicitly set (should probably be changed in Numba itself). Most of the exceptions changed were
TypeErrors
, but a few wereValueErrors
that really ought to have been type errors. (Not finding a record field by name is a type error in compiled code.)Vector is already up-to-date with respect to
TypeError
versusnumba.TypingError
.