Skip to content

Commit

Permalink
add test for list element field name
Browse files Browse the repository at this point in the history
  • Loading branch information
coastalwhite committed Jul 23, 2024
1 parent 398f781 commit 498b207
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions py-polars/tests/unit/io/test_parquet.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,3 +1244,21 @@ def test_parquet_record_batches_pyarrow_fixed_size_list_16614(tmp_path: Path) ->

assert b["x"].shape[0] == n
assert_frame_equal(b, x)


@pytest.mark.write_disk()
def test_parquet_list_element_field_name(tmp_path: Path) -> None:
filename = tmp_path / "list.parquet"

(
pl.DataFrame(
{
"a": [[1, 2], [1, 1, 1]],
},
schema={"a": pl.List(pl.Int64)},
).write_parquet(filename, use_pyarrow=False)
)

schema_str = str(pq.read_schema(filename))
assert "<element: int64>" in schema_str
assert "child 0, element: int64" in schema_str

0 comments on commit 498b207

Please sign in to comment.