Skip to content

BUG: clear cache on DataFrame._is_homogeneous_dtype #34937

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 1 commit into from
Jun 24, 2020

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@@ -611,7 +611,8 @@ def _is_homogeneous_type(self) -> bool:
if self._mgr.any_extension_types:
return len({block.dtype for block in self._mgr.blocks}) == 1
else:
return not self._mgr.is_mixed_type
# Note: consolidates inplace
Copy link
Contributor

@jreback jreback Jun 23, 2020

Choose a reason for hiding this comment

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

i would rather just push this entire thing to the manager, the frame/series shouldn't really be in charge of this as its accessing internal apis (or at least eventually they will be)

Copy link
Member Author

Choose a reason for hiding this comment

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

semi-agree: we shouldnt mix-and-match. But _item_cache pretty much has to be on DataFrame, since that is where the Series objects are created.

@jreback jreback added API - Consistency Internal Consistency of API/Behavior Internals Related to non-user accessible pandas implementation labels Jun 23, 2020
@jreback jreback added this to the 1.1 milestone Jun 24, 2020
@jreback jreback merged commit 7dc86cc into pandas-dev:master Jun 24, 2020
@jbrockmendel jbrockmendel deleted the bug-_is_mixed_type branch June 24, 2020 23:52
fangchenli pushed a commit to fangchenli/pandas that referenced this pull request Jun 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Internals Related to non-user accessible pandas implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants