-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: fix construction of NonConsolidatableBlock with inconsistent ndim #27786
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
@@ -273,6 +273,8 @@ def make_block_same_class(self, values, placement=None, ndim=None, dtype=None): | |||
) | |||
if placement is None: | |||
placement = self.mgr_locs | |||
if ndim is None: | |||
ndim = self.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.
Alternative option is to pass self.ndim
to the make_block_same_class
call in Block.take_nd
, but this might be more general for other locations where make_block_same_class
is called without specifying ndim
. I don't directly can think of a case where you don't want to preserve the ndim unless it was specified.
And eg make_block
just above always uses self.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.
This seems reasonable to me
I tried once to require that ndim be passed and found that some of the downstream tests failed because e.g. pyarrow uses make_block directly |
That's indeed another option to pass
But this is |
Yah, looks like pyarrow is only calling the make_block function, not the methods. |
thanks @jorisvandenbossche |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff