Skip to content
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

[REVIEW] Deprecate Index.is_* methods #12820

Merged
merged 23 commits into from
Mar 8, 2023

Conversation

galipremsagar
Copy link
Contributor

@galipremsagar galipremsagar commented Feb 22, 2023

Description

This PR deprecates the following Index APIs to match with pandas 2.0:

  • is_numeric
  • is_boolean
  • is_integer
  • is_floating
  • is_object
  • is_categorical
  • is_interval

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@galipremsagar galipremsagar added Python Affects Python cuDF API. 4 - Needs cuDF (Python) Reviewer improvement Improvement / enhancement to an existing function breaking Breaking change labels Feb 22, 2023
@galipremsagar galipremsagar self-assigned this Feb 22, 2023
@galipremsagar galipremsagar requested a review from a team as a code owner February 22, 2023 03:01
python/cudf/cudf/core/index.py Outdated Show resolved Hide resolved
return arr_or_dtype._is_boolean()
elif isinstance(arr_or_dtype, cudf.Series):
if isinstance(arr_or_dtype.dtype, cudf.CategoricalDtype):
return is_bool_dtype(arr_or_dtype=arr_or_dtype.dtype)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be checking the boolean dtype of the categories?

Suggested change
return is_bool_dtype(arr_or_dtype=arr_or_dtype.dtype)
return is_bool_dtype(arr_or_dtype=arr_or_dtype.dtype.categories)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a branch for CategoricalDtype at line 278 that will do this step while also generalizing for our CategoricalDtype.

python/cudf/cudf/api/types.py Outdated Show resolved Hide resolved
@galipremsagar galipremsagar requested a review from shwina February 22, 2023 18:50
@galipremsagar galipremsagar requested a review from shwina March 6, 2023 20:11
Copy link
Contributor

@shwina shwina left a comment

Choose a reason for hiding this comment

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

LGTM!

@galipremsagar galipremsagar added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team 4 - Needs cuDF (Python) Reviewer labels Mar 8, 2023
@galipremsagar
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit 50f7e68 into rapidsai:branch-23.04 Mar 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge breaking Breaking change improvement Improvement / enhancement to an existing function Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants