-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
REGR: CategoricalIndex(None) #41612
Conversation
jbrockmendel
commented
May 22, 2021
•
edited
Loading
edited
- closes REGR: empty CatgoricalIndex constructor by passing no data (but passing categories) no longer working #38944
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
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.
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" |
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.
we still want to test this message with a scalar passed
@@ -12,10 +12,14 @@ | |||
|
|||
class TestCategoricalIndexConstructors: | |||
def test_construction_disallows_scalar(self): |
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.
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) |
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.
in #38614 some tests were changed. so I guess we should also be checking the result as well as that a warning is raised.
whatsnew note added, tests edited per suggestion |
Thanks @jbrockmendel |