-
-
Notifications
You must be signed in to change notification settings - Fork 18.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
API: implement __array_function__ for ExtensionArray #35032
API: implement __array_function__ for ExtensionArray #35032
Conversation
while adding dispatch from numpy to concat_compat, it was discovered that the axis argument is ignored for EAs. changing this fixes another bug, so the relevant change has been broken off into a separate PR #35038 to be reviewed first and reduce the diff here to just the changes required to get tests passing with __array_function__ on master
|
Thanks. I think this should probably be a mixin that arrays can opt into by inheriting from it. |
for out internal EAs we could opt-in for all. It maybe that we don't need to opt-in for PandasArray and just opt-in for StringArray |
opt-in for a subclass of a class that doesn't opt-in seems more trouble than it's worth since would need to override some of the inherited methods. so will add tests back for PandasArray and add ArrayFunctionMixin shortly. |
tests failing
the changes to make this work was broken off in #35038 but reverted in #36115 so I either need to add this changes back in here or delete this test. |
after some more thought I not so sure this is a good idea, otherwise we won't be able to use the numpy api in the codebase in the future to avoid special casing EAs in the code which was my motivation for investigating this. of course, this would be an additional burden on 3rd party EA authors so needs further consideration, xref #32586 |
xref #26380