Skip to content

REGR: CategoricalIndex(None) #41612

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
May 25, 2021
Merged

Conversation

jbrockmendel
Copy link
Member

@jbrockmendel jbrockmendel commented May 22, 2021

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.

Thanks @jbrockmendel needs a release note mentioning the deprecated behavior

@@ -12,10 +12,14 @@

class TestCategoricalIndexConstructors:
def test_construction_disallows_scalar(self):
msg = "must be called with a collection of some kind"
Copy link
Member

Choose a reason for hiding this comment

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

we still want to test this message with a scalar passed

@@ -12,10 +12,14 @@

class TestCategoricalIndexConstructors:
def test_construction_disallows_scalar(self):
Copy link
Member

Choose a reason for hiding this comment

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

need to change the name of this test

@@ -12,10 +12,14 @@

class TestCategoricalIndexConstructors:
def test_construction_disallows_scalar(self):
msg = "must be called with a collection of some kind"
with pytest.raises(TypeError, match=msg):
with tm.assert_produces_warning(FutureWarning, match="without passing data"):
CategoricalIndex(categories=list("abcd"), ordered=False)
Copy link
Member

Choose a reason for hiding this comment

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

in #38614 some tests were changed. so I guess we should also be checking the result as well as that a warning is raised.

@simonjayhawkins simonjayhawkins added Categorical Categorical Data Type Deprecate Functionality to remove in pandas Index Related to the Index class or subclasses labels May 22, 2021
@simonjayhawkins simonjayhawkins added this to the 1.3 milestone May 22, 2021
@jbrockmendel
Copy link
Member Author

whatsnew note added, tests edited per suggestion

@simonjayhawkins simonjayhawkins merged commit ce1205e into pandas-dev:master May 25, 2021
@simonjayhawkins
Copy link
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the regr-38944 branch May 25, 2021 14:19
TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Categorical Categorical Data Type Deprecate Functionality to remove in pandas Index Related to the Index class or subclasses
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REGR: empty CatgoricalIndex constructor by passing no data (but passing categories) no longer working
2 participants