Skip to content

[C++][Python] Support constructing StructArray from list of key-value pairs #26025

@asfimport

Description

@asfimport
item = [
    ('a', 1),
    ('b', 2)
]
ty = pa.struct([
    pa.field('a', type=pa.int8()),
    pa.field('b', type=pa.float64())
])
pa.array([item], type=ty)

raises

ArrowTypeError: Could not convert [('a', 1), ('b', 2)] with type list: was not a dict, tuple, or recognized null value for conversion to struct type

This feature is required for pa.repeat(scalar, n) roundtrip if the type contains duplicated field names.

Reporter: Krisztian Szucs / @kszucs
Assignee: Krisztian Szucs / @kszucs

Related issues:

Note: This issue was originally created as ARROW-10000. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions