Skip to content

[C++] Exporting an ExtensionType with BinaryView or StringView storage to C does not export extra buffer sizes array #46659

@paleolimbot

Description

@paleolimbot

Describe the bug, including details regarding any error messages, version, and platform.

Discovered by @kylebarron when working on GeoArrow WKB extensions! I started geoarrow/geoarrow-python#72 to fix because I thought it was a geoarrow problem but I think it's an Arrow one. In the debugger,

bool need_variadic_buffer_sizes =
data->type->id() == Type::BINARY_VIEW || data->type->id() == Type::STRING_VIEW;

...evaluates to false in the following reprex:

import pyarrow as pa
import geoarrow.pyarrow as ga

wkb_item = b"\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3e\x40\x00\x00\x00\x00\x00\x00\x24\x40"
array = ga.array([wkb_item], ga.wkb_view())

schema_capsule, array_capsule = array.__arrow_c_array__()
rearr = pa.Array._import_from_c_capsule(schema_capsule, array_capsule)
rearr.validate(full=True)
#> pyarrow.lib.ArrowIndexError: View at slot 0 references buffer 0 but there are only 0 data buffers

Component(s)

C++

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions