-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: remove fill_tuple kludge #33310
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
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.
Thanks @jbrockmendel generally lgtm.
pandas/core/internals/managers.py
Outdated
@@ -1396,7 +1394,7 @@ def _slice_take_blocks_ax0(self, slice_or_indexer, fill_tuple=None): | |||
blklocs[mgr_locs.indexer], | |||
axis=0, | |||
new_mgr_locs=mgr_locs, | |||
fill_tuple=None, | |||
fill_value=lib.no_default, |
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.
should this be removed? isn't it an anti-pattern to explicitly pass 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.
good idea
@@ -1339,16 +1339,15 @@ def _slice_take_blocks_ax0(self, slice_or_indexer, fill_tuple=None): | |||
if sl_type in ("slice", "mask"): | |||
return [blk.getitem_block(slobj, new_mgr_locs=slice(0, sllen))] | |||
elif not allow_fill or self.ndim == 1: | |||
if allow_fill and fill_tuple[0] is None: | |||
if allow_fill and fill_value is None: |
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.
is allow_fill now redundant here?
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.
allow_fill is tricky to remove (but this is a start to it)
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.
The allow_fill
is from checking fill_value is not lib.default
. So fill_value is None
is still a different check I think.
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.
what @jorisvandenbossche said
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.
if fill_value is None
, isn't allow_fill
, by definition, True
. so allow_fill
is redundant here and if fill_value is None:
would be the same? nbd though, i must be missing something. will look again. We no longer need the guard, that was previously required with the fill_tuple
__getitem__ call.
No description provided.