-
Notifications
You must be signed in to change notification settings - Fork 915
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 na_sentinel
in factorize
#12817
[REVIEW] Deprecate na_sentinel
in factorize
#12817
Conversation
dtype = min_scalar_type( | ||
max( | ||
len(cats), | ||
-1 | ||
if isinstance(na_sentinel, cudf.Scalar) | ||
and na_sentinel.value is cudf.NA | ||
else na_sentinel, | ||
), | ||
8, | ||
) |
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.
I wonder if it's cleaner for internal methods like this to always accept a cudf.Scalar
when a scalar is expected.
(in the same way that we moved towards internal methods always accepting a ColumnBase
, rather than any column-like object).
@vyasr do you have any thoughts?
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.
I think that's a better idea too, switched to accept only cudf.Scalar
's here.
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.
Yes, I would favor that approach.
Co-authored-by: Matthew Roeschke <[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.
Small change potentially requested, but approving otherwise.
/merge |
Description
This PR:
na_sentinel
infactorize
.use_na_sentinel
as an alternative.sort
infactorize
.The above changes are required as part of enabling pandas 2.0 support.
Checklist