Skip to content

[C++] Zero-case union can't be imported via C Data Interface #14855

@lidavidm

Description

@lidavidm

The zero-case union is apparently not supported by Arrow C++'s C Data interface. I get:

'arrow_type' failed with Invalid: Invalid or unsupported format string: '+us:'

Reproducer for Python:

import pyarrow as pa
from pyarrow.cffi import ffi
empty_union = pa.sparse_union([])
ptr = ffi.new("struct ArrowSchema*")
empty_union._export_to_c(int(ffi.cast("uintptr_t", ptr)))
pa.DataType._import_from_c(int(ffi.cast("uintptr_t", ptr)))
# Traceback (most recent call last):
#   File "<stdin>", line 1, in <module>
#   File "pyarrow/types.pxi", line 248, in pyarrow.lib.DataType._import_from_c
#   File "pyarrow/error.pxi", line 144, in pyarrow.lib.pyarrow_internal_check_status
#   File "pyarrow/error.pxi", line 100, in pyarrow.lib.check_status
# pyarrow.lib.ArrowInvalid: Invalid or unsupported format string: '+us:'

Originally posted by @paleolimbot in apache/arrow-nanoarrow#81 (comment)

Component(s)

C++

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions