-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
DEPR: deprecate Index.is_categorical #50225
DEPR: deprecate Index.is_categorical #50225
Conversation
@topper-123 Please have a look. Although I am not sure why so many of the checks are failing. Could you tell me if you know? |
You have to either
The second option is preferable, but is a bit more demanding, e.g. you will have to learn how to compile the pandas code and more. However I recommend doing that, as there is valuable knowledge in knowing that. see here If you fix this by looking through the logs, press "details" on the right of a test and go through the log text to see if you find the issue. I typically do that by pressing "view raw logs" and searching for the text string "FAILED". You can try that. In this case here are some log texts from your PR, see if this helps: 2022-12-13T09:59:39.0966248Z FAILED pandas/tests/indexes/test_base.py::TestIndex::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0966954Z FAILED pandas/tests/indexes/test_base.py::TestMixedIntIndex::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0967709Z FAILED pandas/tests/indexes/categorical/test_category.py::TestCategoricalIndex::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0968475Z FAILED pandas/tests/indexes/datetimes/test_datetimelike.py::TestDatetimeIndex::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0969201Z FAILED pandas/tests/indexes/interval/test_base.py::TestBase::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0969959Z FAILED pandas/tests/indexes/numeric/test_numeric.py::TestFloatNumericIndex::test_is_categorical_is_deprecated[float64] - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0970741Z FAILED pandas/tests/indexes/numeric/test_numeric.py::TestFloatNumericIndex::test_is_categorical_is_deprecated[float32] - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0971498Z FAILED pandas/tests/indexes/numeric/test_numeric.py::TestIntNumericIndex::test_is_categorical_is_deprecated[int64] - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0972243Z FAILED pandas/tests/indexes/numeric/test_numeric.py::TestIntNumericIndex::test_is_categorical_is_deprecated[int32] - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0972975Z FAILED pandas/tests/indexes/numeric/test_numeric.py::TestIntNumericIndex::test_is_categorical_is_deprecated[int16] - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0973710Z FAILED pandas/tests/indexes/numeric/test_numeric.py::TestIntNumericIndex::test_is_categorical_is_deprecated[int8] - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0974462Z FAILED pandas/tests/indexes/numeric/test_numeric.py::TestUIntNumericIndex::test_is_categorical_is_deprecated[uint64] - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0975245Z FAILED pandas/tests/indexes/period/test_period.py::TestPeriodIndex::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0975963Z FAILED pandas/tests/indexes/ranges/test_range.py::TestRangeIndex::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning'
2022-12-13T09:59:39.0976709Z FAILED pandas/tests/indexes/timedeltas/test_timedelta.py::TestTimedeltaIndex::test_is_categorical_is_deprecated - AssertionError: Did not see expected warning of class 'FutureWarning' |
Great. I do see you have a few unrelated commit among yours. You should get rid of those. |
@topper-123 Is there a clean method of deleting unrelated commits? Also, I think all checks are passed but one |
it looks like they’re gone now, so that’s good. |
All the renaming under the “Returns” sections seem unrelated and not needed for this PR, is that correct? If yes, can you get tid of them. |
Return section? |
In the doc strings, where it starts with
|
I am a bit confused which file/method are you referring to. Did I make any changes in that section as well? |
All the instances where you chaange the text below the "Returns" section. for example in
to
Can you roll back all changes like this. |
Yes, I just found that out through git history, I am on to it |
@topper-123 Now there is a test failure
|
that is unrelated to your PR, but has to do with the CI. I've restarted it, should hopefully work now. I see there is still issues of the type I mentioned above, e.g. |
let me look into it |
Is it fine now? |
Can you have a look at https://github.com/pandas-dev/pandas/pull/50225/files please? There's many unrelated changes which shouldn't be there |
Like @MarcoGorelli says, there are still many unrelated changes. Those need to be removed. Beside looking through https://github.com/pandas-dev/pandas/pull/50225/files, you can locally also use git to see the difference between this and the main branch. Are you using git on the terminal or in a GUI? |
I think the simplest thing at this point might be:
Then do
and type Finally
|
I am using pycharm. Most of these changes happened because I ran git rebase main, I should not have done that. What do you suggest that I should do? |
Ok I will do that. I apologize for the inconvenience. If only I had been more careful and didn't perform 'rebase', I could have avoided this mess. I will be careful in the future. Hope I didn't bother you too much. |
0865ed0
to
e1a2973
Compare
All right, looks very close now. You’ve deleted a text in the whatsnew, that should ger back in, but else, it getting very close. |
Are you referring to this text: |
in case it's useful, here are the commands I would run:
then, fixup any conflicts
and once you get |
f984113
to
78e25cf
Compare
Have a look! |
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.
Nice, looks good to me - over to @topper-123
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.
Looks like you did the rebase correctly, but there is a pre-commit check that still needs fixing up:
Unwanted patterns in tests..............................................................................Failed
- hook id: unwanted-patterns-in-tests
- duration: 0.93s
- exit code: 1
pandas/tests/indexes/common.py:831: "Use pandas.api.types.is_categorical_dtype instead",
That looks like an overzealous pre-commit check (it should not check inside strings), but I don't think regex can (elegantly) differentiate between code and string content? IMO just delete the line |
Looks like this check was added in #39293 IIRC |
Can you try that, @ShisuiUzumaki? |
I will do that |
78e25cf
to
709e004
Compare
Done! |
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.
Should be good now, thanks @ShisuiUzumaki
Yeah, looks good. @MarcoGorelli , do you have access to rerun the Circleci arm CI? |
yeah (and I think you should too?) but if I go to https://app.circleci.com/pipelines/github/pandas-dev/pandas I don't see this branch, so can't see how to restart it it just says
though, which seems unrelated, so perhaps it's OK to just merge |
Yeah, that must be unrelated. I’ ok with merging this, as it’s quite simple. |
Thanks, @ShisuiUzumaki. If this has given you a taste for more, you’re welcome to take on other issues:-) |
doc/source/whatsnew/v2.0.0.rst
file if fixing a bug or adding a new feature.