-
-
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
Changes from all commits
5f8946c
d5e0ec8
3c0b848
f138f45
f5a6c9b
f38434c
6f45917
655ef2c
e0231b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -408,7 +408,10 @@ 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 | ||
assert res.ndim == 1 | ||
assert res._mgr.arrays[0].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 commentThe 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 commentThe 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) |
||
|
||
def test_item(self, data): | ||
# https://github.com/pandas-dev/pandas/pull/30175 | ||
|
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).