-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
BUG: clear only attribute errors in get_attr_string.h::maybe_get_attr #14745
Conversation
Setting warnings from a converted object's `__getattr__` to errors changes the behaviour of `numpy.array`. See #14735.
the CI complains about me using the Edit: turns out the second test does the same as the first |
unless there are others, the only issue left is where to put the tests |
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.
Thanks @keewis |
…numpy#14745) * TST: check whether filtered warnings change behaviour in array() Setting warnings from a converted object's `__getattr__` to errors changes the behaviour of `numpy.array`. See numpy#14735. * MAINT: clear errors raised by `PyArray_LookupSpecial*`
fixes #14735.
With this, filtered warnings (and all exceptions other than
AttributeError
) should be passed through. Though now raisingNotImplementedError
will also bubble up.There are several issues with this fix and I'm not sure how to deal with them:
maybe_get_attr
is still accurate (I didn't really understand what it meant).Also, my knowledge of C is limited, so there may be obvious issues, especially with the signature of the helper.
@seberg, what do you think of this? I can confirm that the original issue can be avoided by explicitly adding
__array__
and warning there, so I don't have to depend on this.