-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN: assorted cleanups #39856
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
CLN: assorted cleanups #39856
Conversation
jbrockmendel
commented
Feb 17, 2021
- closes #xxxx
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
pandas/core/frame.py
Outdated
dtype = blocks[0].dtype | ||
# TODO(EA2D): special case would be unnecessary with 2D EAs | ||
return isinstance(dtype, np.dtype) # i.e. not ExtensionDtype |
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.
dtype = blocks[0].dtype | |
# TODO(EA2D): special case would be unnecessary with 2D EAs | |
return isinstance(dtype, np.dtype) # i.e. not ExtensionDtype | |
return not self._mgr.any_extension_type |
(at this point you know there is only 1 block, so we are not checking it for potentially many columns as was the case before)
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.
This paves the way for the DTBlock/TDBlock-backed-by-DTA/TDA PR, in which this isinstance check is only slightly tweaked
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.
I suppose that those blocks should then still not be considered as "extension block" for any_extension_type
, as the main reason that we use any_extension_type
is to know if it has a non-consolidating / non-transposable block (and which would not be the case for DTBlock)
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 worth arguing about, since only one line is in question and that line will get changed in the upcoming PR anyway. will use the proposed edit.
any other issues here? |