-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
minor inconsistency in Categorical.remove_categories error message #28677
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
Conversation
Hello @punndcoder28! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2019-10-09 17:53:34 UTC |
Nitpick: in the future please give the PR an informative title. Most reviewers won't know off the top of their heads what 28677 is about. |
Yes my bad @jbrockmendel. I realized it after opening the PR sorry. |
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.
can you add or update the tests on remove_categories to account for this change (since nothing broke we likely are not testing it enough)
I had tests as it were suggested by @simonjayhawkins. But there were errors and I didn't know how to handle that. If I could get some guidance I will surely add those and commit the changes. |
If you could tell me what tests I should create I'll create those and commit @jreback. |
@punndcoder28 suitable tests would be similar to those in pandas/tests/arrays/categorical/test_api.py in 8298620 |
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.
@punndcoder28 Thanks for the PR. can you add a whatsnew entry as well.
|
Co-Authored-By: Tom Augspurger <[email protected]>
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.
@punndcoder28 generally looks good. a couple of small changes. also need to merge master to resolve merge conflict. ping on green.
Co-Authored-By: Simon Hawkins <[email protected]>
Co-Authored-By: Simon Hawkins <[email protected]>
How do I resolve a conflict? I tried doing it manually but didn't work. |
see https://dev.pandas.io/docs/development/contributing.html#updating-your-pull-request
|
I did what was mentioned here
But still the tests are failing. |
You need to run |
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.
@punndcoder28 lgtm. @jreback
Hmm is this actually changing anything on master? I ran one of the test cases but already see the intended result? >>> pd.Categorical(["a", "b", "a"]).remove_categories(["c", "c"])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/williamayd/clones/pandas/pandas/core/arrays/categorical.py", line 1132, in remove_categories
raise ValueError(msg.format(not_included=not_included))
ValueError: removals must all be in old categories: {'c'} |
it's changeing the output of from to for all other cases the message remain unchanged and tests are added for these. i.e.
|
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.
Ah OK thanks for clarifying @simonjayhawkins
Thanks @punndcoder28 |
This pull request fixes minor inconsistency in Categorical.remove_categories error message
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Changed the error message to show invalid removals as a set. Added tests for removal of null from the categories. Parameterized pytest.