Skip to content

TYP: internals #32403

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 3 commits into from
Mar 3, 2020
Merged

Conversation

jbrockmendel
Copy link
Member

some of these are a real bear, in particular SingleBlockManager.__init__

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

looks generally good just a question on code changes

@simonjayhawkins

""" return an empty BlockManager with the items axis of len 0 """
if axes is None:
axes = [ensure_index([])] + [ensure_index(a) for a in self.axes[1:]]
axes = [Index([])] + self.axes[1:]
Copy link
Member

Choose a reason for hiding this comment

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

What error was this fixing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not an error, just unnecessarily complicated

@WillAyd WillAyd added the Typing type annotations, mypy/pyright type checking label Mar 3, 2020
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.

@jbrockmendel lgtm. one question, not blocker.

@@ -807,7 +812,7 @@ def _interleave(self):
# TODO: https://github.com/pandas-dev/pandas/issues/22791
# Give EAs some input on what happens here. Sparse needs this.
if is_sparse(dtype):
dtype = dtype.subtype
dtype = dtype.subtype # type: ignore
Copy link
Member

Choose a reason for hiding this comment

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

according to the docstring, is_sparse is to check arrays. so isinstance(dtype, SparseDtype) could be used here to avoid the ignore?

@simonjayhawkins simonjayhawkins added this to the 1.1 milestone Mar 3, 2020
@simonjayhawkins simonjayhawkins merged commit 283f81c into pandas-dev:master Mar 3, 2020
@simonjayhawkins
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the typ-internals branch March 3, 2020 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Typing type annotations, mypy/pyright type checking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants