pyarrow.opaque — Apache Arrow v20.0.0 (original) (raw)
pyarrow.opaque(DataType storage_type, unicode type_name, unicode vendor_name)#
Create instance of opaque extension type.
Parameters:
storage_typeDataType
The underlying data type.
type_namestr
The name of the type in the external system.
vendor_namestr
The name of the external system.
Returns:
typeOpaqueType
Examples
Create an instance of an opaque extension type:
import pyarrow as pa type = pa.opaque(pa.binary(), "other", "jdbc") type OpaqueType(extension<arrow.opaque[storage_type=binary, type_name=other, vendor_name=jdbc]>)
Inspect the data type:
type.storage_type DataType(binary) type.type_name 'other' type.vendor_name 'jdbc'
Create a table with an opaque array:
arr = [None, b"foobar"] storage = pa.array(arr, pa.binary()) other = pa.ExtensionArray.from_storage(type, storage) pa.table([other], names=["unknown_col"]) pyarrow.Table unknown_col: extension<arrow.opaque[storage_type=binary, type_name=other, vendor_name=jdbc]>
unknown_col: [[null,666F6F626172]]