Skip to content

Commit

Permalink
Use newly wrapped nans_to_nulls
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Jul 9, 2024
1 parent e9fb410 commit 49442c5
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions python/cudf/cudf/_lib/transform.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ from rmm._lib.device_buffer cimport DeviceBuffer, device_buffer
cimport cudf._lib.pylibcudf.libcudf.transform as libcudf_transform
from cudf._lib.column cimport Column
from cudf._lib.expressions cimport Expression
from cudf._lib.pylibcudf cimport transform as plc_transform
from cudf._lib.pylibcudf.libcudf.column.column cimport column
from cudf._lib.pylibcudf.libcudf.column.column_view cimport column_view
from cudf._lib.pylibcudf.libcudf.expressions cimport expression
Expand Down Expand Up @@ -82,18 +83,10 @@ def mask_to_bools(object mask_buffer, size_type begin_bit, size_type end_bit):

@acquire_spill_lock()
def nans_to_nulls(Column input):
cdef column_view c_input = input.view()
cdef pair[unique_ptr[device_buffer], size_type] c_output
cdef unique_ptr[device_buffer] c_buffer

with nogil:
c_output = move(libcudf_transform.nans_to_nulls(c_input))
c_buffer = move(c_output.first)

if c_output.second == 0:
return None

return as_buffer(DeviceBuffer.c_from_unique_ptr(move(c_buffer)))
(mask, _) = plc_transform.nans_to_nulls(
input.to_pylibcudf(mode="read")
)
return as_buffer(mask)


@acquire_spill_lock()
Expand Down

0 comments on commit 49442c5

Please sign in to comment.