You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/09/10 08:59:00 UTC
[jira] [Updated] (ARROW-6506) [C++] Validation of ExtensionType
with nested type fails
[ https://issues.apache.org/jira/browse/ARROW-6506?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated ARROW-6506:
----------------------------------
Labels: pull-request-available (was: )
> [C++] Validation of ExtensionType with nested type fails
> --------------------------------------------------------
>
> Key: ARROW-6506
> URL: https://issues.apache.org/jira/browse/ARROW-6506
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Reporter: Joris Van den Bossche
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.15.0
>
>
> A reproducer using the Python ExtensionType:
> {code}
> class MyStructType(pa.ExtensionType):
> def __init__(self):
> storage_type = pa.struct([('a', pa.int64()), ('b', pa.int64())])
> pa.ExtensionType.__init__(self, storage_type, 'my_struct_type')
> def __arrow_ext_serialize__(self):
> return b''
> @classmethod
> def __arrow_ext_deserialize__(self, storage_type, serialized):
> return MyStructType()
> ty = MyStructType()
> storage_array = pa.array([{'a': 1, 'b': 2}], ty.storage_type)
> arr = pa.ExtensionArray.from_storage(ty, storage_array)
> {code}
> then validating this array fails because it expects no children (the extension array itself has no children, only the storage array):
> {code}
> In [8]: arr.validate()
> ---------------------------------------------------------------------------
> ArrowInvalid Traceback (most recent call last)
> <ipython-input-8-13783ce9f25e> in <module>
> ----> 1 arr.validate()
> ~/scipy/repos/arrow/python/pyarrow/array.pxi in pyarrow.lib.Array.validate()
> ~/scipy/repos/arrow/python/pyarrow/error.pxi in pyarrow.lib.check_status()
> ArrowInvalid: Expected 0 child arrays in array of type extension<my_struct_type>, got 2
> {code}
--
This message was sent by Atlassian Jira
(v8.3.2#803003)