[
https://issues.apache.org/jira/browse/ARROW-5610?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16902176#comment-16902176
]
Joris Van den Bossche commented on ARROW-5610:
----------------------------------------------
> But which also means that you loose all information about the extension type
> defined elsewhere (as discussed above).
Correcting myself: this is not fully True. The _type_ is no longer an extension
type (but the storage type), but the _field_ in the schema still has the
metadata.
For example, reading an IPC file with python for an not-registered type
(created from C++ where the 'ext' column was a Uuid type as defined in the
tests):
{code}
In [31]: f_ext =
pa.ipc.open_stream("repos/arrow/cpp/build/examples/arrow/arrow-example-ipc-extension.arrow")
In [32]: table = f_ext.read_all()
In [33]: table
Out[33]:
pyarrow.Table
int: int64
ext: int64
In [35]: table.schema.field_by_name('ext')
Out[35]: pyarrow.Field<ext: int64>
In [36]: table.schema.field_by_name('ext').metadata
Out[36]:
{b'ARROW:extension:metadata': b'uuid-type-unique-code',
b'ARROW:extension:name': b'uuid'}
{code}
> [Python] Define extension type API in Python to "receive" or "send" a foreign
> extension type
> --------------------------------------------------------------------------------------------
>
> Key: ARROW-5610
> URL: https://issues.apache.org/jira/browse/ARROW-5610
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Python
> Reporter: Wes McKinney
> Priority: Major
> Fix For: 1.0.0
>
>
> In work in ARROW-840, a static {{arrow.py_extension_type}} name is used.
> There will be cases where an extension type is coming from another
> programming language (e.g. Java), so it would be useful to be able to "plug
> in" a Python extension type subclass that will be used to deserialize the
> extension type coming over the wire. This has some different API requirements
> since the serialized representation of the type will not have knowledge of
> Python pickling, etc.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)