Skip to content

Commit

Permalink
Replaces uses of cudf._lib.Column.from_unique_ptr with pylibcudf.Colu…
Browse files Browse the repository at this point in the history
…mn.from_libcudf
  • Loading branch information
Matt711 committed Dec 4, 2024
1 parent cd3e352 commit 0ee9ac0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions python/cudf/cudf/_lib/strings_udf.pyx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

from libc.stdint cimport uint8_t, uint16_t, uintptr_t

from pylibcudf.libcudf.strings_udf cimport (
get_character_cases_table as cpp_get_character_cases_table,
get_character_flags_table as cpp_get_character_flags_table,
Expand All @@ -27,6 +26,7 @@ from rmm.librmm.device_buffer cimport device_buffer
from rmm.pylibrmm.device_buffer cimport DeviceBuffer

from cudf._lib.column cimport Column
from pylibcudf cimport Column as plc_Column


def get_cuda_build_version():
Expand All @@ -52,9 +52,9 @@ def column_from_udf_string_array(DeviceBuffer d_buffer):
c_result = move(cpp_column_from_udf_string_array(data, size))
cpp_free_udf_string_array(data, size)

result = Column.from_unique_ptr(move(c_result))

return result
return Column.from_pylibcudf(
plc_Column.from_libcudf(move(c_result))
)


def get_character_flags_table_ptr():
Expand Down
11 changes: 6 additions & 5 deletions python/cudf/cudf/_lib/utils.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ from pylibcudf.libcudf.table.table_view cimport table_view
from pylibcudf.libcudf.types cimport size_type

from cudf._lib.column cimport Column

from pylibcudf cimport Column as plc_Column
try:
import ujson as json
except ImportError:
Expand Down Expand Up @@ -223,10 +223,11 @@ cdef columns_from_unique_ptr(

cdef size_t i

columns = [Column.from_unique_ptr(move(dereference(it+i)))
for i in range(c_columns.size())]

return columns
return [
Column.from_pylibcudf(
plc_Column.from_libcudf(move(dereference(it+i)))
) for i in range(c_columns.size())
]


cpdef columns_from_pylibcudf_table(tbl):
Expand Down

0 comments on commit 0ee9ac0

Please sign in to comment.