Skip to content

fixed_size_list<T>[0] parquet round-trips fail: writes fine, read-back raises ArrowInvalid #49683

@ikrommyd

Description

@ikrommyd

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

A fixed_size_list<T> array with list_size=0 can be written to Parquet successfully but fails to read back with

ArrowInvalid: Expected all lists to be of size=0 but index 1 had size=1

Note also that the high-level constructor pa.FixedSizeListArray.from_arrays explicitly rejects list_size=0 with "list_size needs to be a strict positive integer", but the type can still be constructed via Array.from_buffers, and pq.write_table accepts it without complaint. The API is inconsistent: either the type should be rejected everywhere, or it should round-trip correctly.

inner = pa.array([], type=pa.float32())  # 0 child values
fsl = pa.FixedSizeListArray.from_arrays(inner, list_size=0)

raises

ArrowInvalid: list_size needs to be a strict positive integer

Reproducer

import pyarrow as pa
import pyarrow.parquet as pq

fsl = pa.Array.from_buffers(
    pa.list_(pa.float32(), 0),
    length=50,
    buffers=[None],
    children=[pa.array([], type=pa.float32())],
)
table = pa.table({"x": fsl})

pq.write_table(table, "tmp.parquet")   # OK
pq.read_table("tmp.parquet")           # ArrowInvalid

Component(s)

Parquet, Python

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions