-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
[ArrayManager] TST: Enable extension tests #40348
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
[ArrayManager] TST: Enable extension tests #40348
Conversation
General note: I am using the |
@jreback @jbrockmendel any comments here? (trying to get all testing PRs merged to reduce the custom selection) |
Will take a look now. |
return self._get_data_subset(lambda arr: is_numeric_dtype(arr.dtype)) | ||
return self._get_data_subset( | ||
lambda arr: is_numeric_dtype(arr.dtype) | ||
or getattr(arr.dtype, "_is_numeric", False) |
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.
seems like is_numeric_dtype should catch this?
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.
It maybe should, but it doesn't at the moment.
The above is mimicking the logic of the BlockManager (ExtensionBlock.is_numeric checks this attribute of the dtype). But it's certainly inconsistent .. The consequence of the inconsistency is that eg decimal is considered numeric for groupby operations, but is_numeric_dtype(decimal_dtype)
will return False (not sure where this would have a direct impact).
@@ -388,7 +388,8 @@ def test_loc_len1(self, data): | |||
# see GH-27785 take_nd with indexer of len 1 resulting in wrong ndim | |||
df = pd.DataFrame({"A": data}) | |||
res = df.loc[[0], "A"] | |||
assert res._mgr._block.ndim == 1 | |||
if hasattr(res._mgr, "blocks"): | |||
assert res._mgr._block.ndim == 1 |
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 think OK to just check res._mgr.ndim (or even just res.ndim)
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 added a check for the ndim of mgr (so there is also a check for ArrayManager), but left the block ndim check in place, because the original bug was that only the block ndim was wrong (the manager ndim was correct)
looks fine, may want to rebase |
xref #39146