Skip to content

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

Merged
merged 2 commits into from
Apr 6, 2020
Merged

Conversation

jbrockmendel
Copy link
Member

No description provided.

Copy link
Member

@simonjayhawkins simonjayhawkins left a 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.

@@ -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,
Copy link
Member

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.

Copy link
Member Author

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:
Copy link
Member

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?

Copy link
Contributor

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)

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

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.

@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Apr 6, 2020
@jreback jreback merged commit 2c82446 into pandas-dev:master Apr 6, 2020
@jbrockmendel jbrockmendel deleted the fill_tuple branch April 6, 2020 21:40
jbrockmendel added a commit to jbrockmendel/pandas that referenced this pull request Apr 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants