diff --git a/python/cudf/cudf/_lib/column.pyx b/python/cudf/cudf/_lib/column.pyx index 9cbe11d61ac..245a5d03981 100644 --- a/python/cudf/cudf/_lib/column.pyx +++ b/python/cudf/cudf/_lib/column.pyx @@ -42,8 +42,7 @@ cimport pylibcudf.libcudf.types as libcudf_types cimport pylibcudf.libcudf.unary as libcudf_unary from pylibcudf.libcudf.column.column cimport column, column_contents from pylibcudf.libcudf.column.column_factories cimport ( - make_column_from_scalar as cpp_make_column_from_scalar, - make_numeric_column, + make_numeric_column ) from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.null_mask cimport null_count as cpp_null_count @@ -840,9 +839,8 @@ cdef class Column: @staticmethod def from_scalar(py_val, size_type size): - cdef DeviceScalar val = py_val.device_value - cdef const scalar* c_val = val.get_raw_ptr() - cdef unique_ptr[column] c_result - with nogil: - c_result = move(cpp_make_column_from_scalar(c_val[0], size)) - return Column.from_unique_ptr(move(c_result)) + return Column.from_pylibcudf( + pylibcudf.Column.from_scalar( + py_val.device_value.c_value, size + ) + ) diff --git a/python/cudf/cudf/_lib/copying.pyx b/python/cudf/cudf/_lib/copying.pyx index 4dfb12d8ab3..1f3f03f4be1 100644 --- a/python/cudf/cudf/_lib/copying.pyx +++ b/python/cudf/cudf/_lib/copying.pyx @@ -3,8 +3,6 @@ import pickle from libcpp cimport bool -from libcpp.memory cimport unique_ptr -from libcpp.utility cimport move import pylibcudf import cudf @@ -18,10 +16,6 @@ from cudf._lib.scalar cimport DeviceScalar from cudf._lib.reduce import minmax -from libcpp.memory cimport make_unique - -from pylibcudf.libcudf.column.column cimport column -from pylibcudf.libcudf.column.column_view cimport column_view from pylibcudf.libcudf.types cimport size_type from cudf._lib.utils cimport columns_from_pylibcudf_table, data_from_pylibcudf_table @@ -59,12 +53,9 @@ def copy_column(Column input_column): ------- Deep copied column """ - cdef unique_ptr[column] c_result - cdef column_view input_column_view = input_column.view() - with nogil: - c_result = move(make_unique[column](input_column_view)) - - return Column.from_unique_ptr(move(c_result)) + return Column.from_pylibcudf( + input_column.to_pylibcudf(mode="read").copy() + ) @acquire_spill_lock()