pyarrow.opaque#

pyarrow.opaque(DataTypestorage_type,strtype_name,strvendor_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:

>>>importpyarrowaspa>>>type=pa.opaque(pa.binary(),"other","jdbc")>>>typeOpaqueType(extension<arrow.opaque[storage_type=binary, type_name=other, vendor_name=jdbc]>)

Inspect the data type:

>>>type.storage_typeDataType(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.Tableunknown_col: extension<arrow.opaque[storage_type=binary, type_name=other, vendor_name=jdbc]>----unknown_col: [[null,666F6F626172]]