-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: hold PeriodArray in NDArrayBackedExtensionBlock #44681
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
pandas/core/internals/managers.py
Outdated
stacklevel=find_stack_level(), | ||
) | ||
else: | ||
warnings.warn( |
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.
these warnings tested?
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.
not the new one; need to revert it since ive xfailed the cases that get here
@jbrockmendel what's the direct advantage of using NDArrayBackedExtensionBlock instead of ExtensionBlock for PeriodArray? Because this broke the pyarrow integration for period dtype up to pyarrow 3.0 (released just less than a year ago) |
2D support! |
And can you do that without breaking pyarrow <= 3.0? |
I dont know what private APIs it uses. Might be able to put in a shim. |
They are already using the Letting it infer it works fine (what happens on the latest pyarrow releases):
but explicitly asking for an ExtensionBlock gives a mangled block with a 2D array under the hood (and for that reason it thinks it is shape (1, 1), because the underlying array is (1, 3)):
|
yah it shouldn't do that. we could put a shim in |
And it already doesn't do that anymore.
Can't we handle that inside |
makes sense |
After this, Categorical will be the only NDArrayBackedExtensionArray not held in NDarrayBackedExtensionBlock.
(this also fixes a Series.where bug for PeriodDtype, the general fix (and tests) are blocked by #44514)