interop#

2026-03-11

20 min read time

Applies to Linux

class pylibhipdf.interop.ColumnMetadata(name: str = '', timezone: str = '', precision: int | None = None, children_meta: list[~pylibcudf._interop_helpers.ColumnMetadata] = <factory>)#

Bases: object

Metadata associated with a column.

This is the Python representation of cudf::column_metadata.

__init__(name: str = '', timezone: str = '', precision: int | None = None, children_meta: list[~pylibcudf._interop_helpers.ColumnMetadata] = <factory>) None#
name: str = ''#
precision: int | None = None#
timezone: str = ''#
children_meta: list[ColumnMetadata]#
pylibhipdf.interop.from_arrow(pyarrow_object, *, DataType data_type=None)#
pylibhipdf.interop.from_arrow(pyarrow_object: DataType)
pylibhipdf.interop.from_arrow(pyarrow_object: Table, *, data_type=None)
pylibhipdf.interop.from_arrow(pyarrow_object: Scalar, *, data_type=None, stream=None)
pylibhipdf.interop.from_arrow(pyarrow_object: Array, *, data_type=None)

Create a cudf object from a pyarrow object.

Parameters#

pyarrow_objectUnion[pyarrow.Array, pyarrow.Table, pyarrow.Scalar]

The PyArrow object to convert.

Returns#

Union[Table, Scalar]

The converted object of type corresponding to the input type in cudf.

pylibhipdf.interop.from_dlpack(managed_tensor, Stream stream=None, DeviceMemoryResource mr=None) Table#

Convert a DLPack DLTensor into a cudf table.

For details, see cudf::from_dlpack()

Parameters#

managed_tensorPyCapsule

A 1D or 2D column-major (Fortran order) tensor.

streamStream | None

CUDA stream on which to perform the operation.

mrDeviceMemoryResource | None

Device memory resource used to allocate the returned table’s device memory.

Returns#

Table

Table with a copy of the tensor data.

pylibhipdf.interop.to_arrow(plc_object, **kwargs)#
pylibhipdf.interop.to_arrow(plc_object: DataType, **kwargs)
pylibhipdf.interop.to_arrow(plc_object: Table, metadata=None)
pylibhipdf.interop.to_arrow(plc_object: Column, metadata=None)
pylibhipdf.interop.to_arrow(plc_object: Scalar, metadata=None)

Convert to a PyArrow object.

Parameters#

plc_objectUnion[Column, Table, Scalar]

The cudf object to convert.

metadatalist

The metadata to attach to the columns of the table.

Returns#

Union[pyarrow.Array, pyarrow.Table, pyarrow.Scalar]

The converted object of type corresponding to the input type in PyArrow.

pylibhipdf.interop.to_dlpack(Table input, Stream stream=None, DeviceMemoryResource mr=None)#

Convert a cudf table into a DLPack DLTensor.

For details, see cudf::to_dlpack()

Parameters#

inputTable

A 1D or 2D column-major (Fortran order) tensor.

streamStream | None

CUDA stream on which to perform the operation.

mrDeviceMemoryResource | None

Device memory resource used to allocate the returned DLPack tensor’s device memory.

Returns#

PyCapsule

1D or 2D DLPack tensor with a copy of the table data, or nullptr.