Skip to content

TYP: enforce tighter inputs on SingleBlockManager #33092

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 5 commits into from
Mar 30, 2020

Conversation

jbrockmendel
Copy link
Member

there is currently only one place where we pass a list of indexes instead of a single index, so just fixed that and were good to go.

@@ -1649,6 +1640,7 @@ def concat(self, to_concat, new_axis: Index) -> "SingleBlockManager":
-------
SingleBlockManager
"""
assert isinstance(new_axis, Index), new_axis
Copy link
Member

Choose a reason for hiding this comment

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

this is already asserted in the SingleBlockManager constructor, so is not needed here?

@@ -1515,25 +1515,14 @@ class SingleBlockManager(BlockManager):
def __init__(
self,
block: Block,
axis: Union[Index, List[Index]],
axis: Index,
do_integrity_check: bool = False,
fastpath: bool = False,
Copy link
Member

Choose a reason for hiding this comment

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

fastpath has no effect anymore, now? It is still being used in places internally?

@jreback jreback added the Internals Related to non-user accessible pandas implementation label Mar 29, 2020
@jreback
Copy link
Contributor

jreback commented Mar 29, 2020

lgtm. rebase and @jorisvandenbossche has some comments, ping on green.

@jreback jreback added this to the 1.1 milestone Mar 29, 2020
@jreback jreback added the Typing type annotations, mypy/pyright type checking label Mar 29, 2020
@jbrockmendel
Copy link
Member Author

@jorisvandenbossche i think ive addressed your comments, can you confirm?

@jorisvandenbossche
Copy link
Member

Yes, thanks.

One more thing, though. For Block, we actually deprecated fastpath first instead of directly removing (only the passing of the keyword, I mean, not any functionality, #19265). I assume SingleBlockManager will be used less in practice, but it's also not much work to still accept fastpath and raise a warning for it for now.

@jbrockmendel
Copy link
Member Author

deprecated fastpath first instead of directly removing

Sure

@jorisvandenbossche jorisvandenbossche merged commit f542723 into pandas-dev:master Mar 30, 2020
@jorisvandenbossche
Copy link
Member

Thanks!

@jbrockmendel jbrockmendel deleted the typ-sbm branch March 30, 2020 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internals Related to non-user accessible pandas implementation Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants