Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
A reproducer using the Python ExtensionType:
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)
then validating this array fails because it expects no children (the extension array itself has no children, only the storage array):
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
Attachments
Issue Links
- links to