Open spenczar opened 1 year ago
Actually, making the array explicitly with StructArray.from_arrays works:
def make_struct_array_explicitly():
data = [1, 2, 3, 4, 5]
typ = CustomExtensionType()
return pa.StructArray.from_arrays([pa.array(data, typ)], fields=[("val", typ)])
So I think this is really about pa.array
's handling of structs that contain extension types.
Is there anyone who can shine some light on this issue? It's turned into somewhat of a blocker for me. I need to construct a table with nested extension arrays insides structs using pyarrow
Describe the bug, including details regarding any error messages, version, and platform.
I have a custom PyExtensionType. I would like to use that value for a field of an array, and use that array inside a larger data structure.
I'm able to use the extension type directly in
pa.array
, but if I use apa.struct
to wrap it up, it fails.Here is a minimal reproducer. Running
make_array_ok()
does not error. Runningmake_struct_array_not_ok()
results in an error.The error is not very clear to me:
Version info
cp310-cp310-macosx_11_0_arm64
)Component(s)
Python