-
Notifications
You must be signed in to change notification settings - Fork 917
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
Move unnecessary utilities from cudf._lib.scalar #17636
Move unnecessary utilities from cudf._lib.scalar #17636
Conversation
python/cudf/cudf/utils/utils.py
Outdated
if is_na_like(slr): | ||
return True | ||
elif ( | ||
isinstance(slr, (np.datetime64, np.timedelta64)) and np.isnat(slr) | ||
) or slr is pd.NaT: | ||
return True | ||
else: | ||
return 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.
Try to combine this into something like:
return is_na_like(slr) or (isinstance(slr, (np.datetime64, np.timedelta64)) and np.isnat(slr) or slr is pd.NaT
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.
Or if you leave it the long way, maybe add comments that help explain the second case.
Waiting for nv-morpheus/Morpheus#2090 before merging this |
/merge |
Description
In preparation for transitioning
DeviceScalar
to pylibcudf'sScalar
, moving_is_null_host_scalar
(a pure Python function) tocudf.utils.utils
and removesas_device_scalar
in favor of going throughcudf.Scalar
Checklist