Skip to content

TST: fix test creating invalid CategoricalBlock #32519

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 14, 2020

Conversation

jbrockmendel
Copy link
Member

The incorrect tests here turned up when trying to replace Block.get_values calls with simpler alternatives.

@@ -1745,6 +1745,10 @@ def __init__(self, values, placement, ndim=None):
values = self._maybe_coerce_values(values)
super().__init__(values, placement, ndim)

if self.ndim == 2 and len(self.mgr_locs) != 1:
Copy link
Contributor

Choose a reason for hiding this comment

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

woa, why is this here? shouldn't this be in a higher level block construction?

Copy link
Member Author

Choose a reason for hiding this comment

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

either goes here or in NonconsolidateableMixin (which should be merged into ExtensionBlock anyway)

Copy link
Contributor

Choose a reason for hiding this comment

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

no this is not what i mean. how can we possibly get here when passing a Categorical? and if you can't except by directly constructing a manager, then this should be an assertion error.

Copy link
Member Author

Choose a reason for hiding this comment

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

then this should be an assertion error.

sure, will update

@jreback jreback added the Categorical Categorical Data Type label Mar 11, 2020
@jreback jreback added this to the 1.1 milestone Mar 11, 2020
@jreback
Copy link
Contributor

jreback commented Mar 11, 2020

k merge on green

@jbrockmendel jbrockmendel merged commit f35bcac into pandas-dev:master Mar 14, 2020
@jbrockmendel jbrockmendel deleted the invalid_ea_block branch March 14, 2020 15:50
SeeminSyed pushed a commit to CSCD01-team01/pandas that referenced this pull request Mar 22, 2020
* TST: fix test creating invalid CategoricalBlock

* ValueError->AssertionError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants