Skip to content

Commit

Permalink
Use pylibcudf.strings.convert.convert_integers.is_integer in cudf p…
Browse files Browse the repository at this point in the history
…ython (#17270)

Apart of #15162

Authors:
  - Matthew Murray (https://github.com/Matt711)

Approvers:
  - Matthew Roeschke (https://github.com/mroeschke)

URL: #17270
  • Loading branch information
Matt711 authored Nov 7, 2024
1 parent 64c72fc commit 773aefc
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions python/cudf/cudf/_lib/strings/convert/convert_integers.pyx
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# Copyright (c) 2021-2024, NVIDIA CORPORATION.

from libcpp.memory cimport unique_ptr
from libcpp.utility cimport move

from cudf.core.buffer import acquire_spill_lock

from pylibcudf.libcudf.column.column cimport column
from pylibcudf.libcudf.column.column_view cimport column_view
from pylibcudf.libcudf.strings.convert.convert_integers cimport (
is_integer as cpp_is_integer,
)
import pylibcudf as plc

from cudf._lib.column cimport Column

Expand All @@ -20,12 +13,8 @@ def is_integer(Column source_strings):
Returns a Column of boolean values with True for `source_strings`
that have integers.
"""
cdef unique_ptr[column] c_result
cdef column_view source_view = source_strings.view()

with nogil:
c_result = move(cpp_is_integer(
source_view
))

return Column.from_unique_ptr(move(c_result))
return Column.from_pylibcudf(
plc.strings.convert.convert_integers.is_integer(
source_strings.to_pylibcudf(mode="read")
)
)

0 comments on commit 773aefc

Please sign in to comment.