Skip to content

[Python] Support converting map to dict (instead of list of tuples) in scalar conversion / to_pylist #39010

@adriangb

Description

@adriangb

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

import pyarrow as pa

schema = pa.schema([pa.field('x', pa.map_(pa.string(), pa.int64()))])
data = [{'x': {'a': 1}}]
pa.RecordBatch.from_pylist(data, schema=schema).to_pylist()
# [{'x': [('a', 1)]}]

I understand that this may be how it's stored internally but I feel like it should be converted to a dict.

Using struct is not an option because my keys are not fixed.

Component(s)

Python

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions