Skip to content
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

Use pylibcudf.strings.convert.convert_integers.is_integer in cudf python #17270

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
)
)
Loading