-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
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
TYP: internals #32403
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.
looks generally good just a question on code changes
""" 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:] |
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 error was this fixing?
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.
Not an error, just unnecessarily complicated
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.
@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 |
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.
according to the docstring, is_sparse is to check arrays. so isinstance(dtype, SparseDtype) could be used here to avoid the ignore?
Thanks @jbrockmendel |
some of these are a real bear, in particular
SingleBlockManager.__init__