Skip to content

Move unnecessary utilities from cudf._lib.scalar#17636

Merged
rapids-bot[bot] merged 6 commits intorapidsai:branch-25.02from
mroeschke:cln/cudf/_lib/scalar
Jan 7, 2025
Merged

Move unnecessary utilities from cudf._lib.scalar#17636
rapids-bot[bot] merged 6 commits intorapidsai:branch-25.02from
mroeschke:cln/cudf/_lib/scalar

Conversation

@mroeschke
Copy link
Contributor

@mroeschke mroeschke commented Dec 19, 2024

Description

In preparation for transitioning DeviceScalar to pylibcudf's Scalar, moving _is_null_host_scalar (a pure Python function) to cudf.utils.utils and removes as_device_scalar in favor of going through cudf.Scalar

Checklist

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

@mroeschke mroeschke added Python Affects Python cuDF API. improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 19, 2024
@mroeschke mroeschke self-assigned this Dec 19, 2024
@mroeschke mroeschke requested a review from a team as a code owner December 19, 2024 20:17
@mroeschke mroeschke requested review from Matt711 and bdice December 19, 2024 20:17
Comment on lines +345 to +352
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
Copy link
Contributor

@bdice bdice Dec 20, 2024

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

Copy link
Contributor

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.

@mroeschke
Copy link
Contributor Author

Waiting for nv-morpheus/Morpheus#2090 before merging this

@mroeschke
Copy link
Contributor Author

/merge

@rapids-bot rapids-bot bot merged commit a0487be into rapidsai:branch-25.02 Jan 7, 2025
@mroeschke mroeschke deleted the cln/cudf/_lib/scalar branch January 7, 2025 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change Python Affects Python cuDF API.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants