Skip to content

Commit a0149d8

Browse files
committed
Add test for compliant Parquet
1 parent cc7e6a8 commit a0149d8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pandas/tests/io/test_parquet.py

+15
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from pandas.compat.pyarrow import (
1818
pa_version_under1p0,
1919
pa_version_under2p0,
20+
pa_version_under4p0,
2021
pa_version_under5p0,
2122
)
2223
import pandas.util._test_decorators as td
@@ -931,6 +932,20 @@ def test_read_parquet_manager(self, pa, using_array_manager):
931932
else:
932933
assert isinstance(result._mgr, pd.core.internals.BlockManager)
933934

935+
@td.skip_if_no("pyarrow", min_version="4.0.0")
936+
def test_list_column_results_in_compliant_parquet(self, pa):
937+
# https://github.com/pandas-dev/pandas/issues/26551
938+
df = pd.DataFrame({"a": [[1], [2]]})
939+
940+
with tm.ensure_clean() as path:
941+
df.to_parquet(path, pa)
942+
result = pyarrow.parquet.read_table(path)
943+
944+
assert (
945+
str(result.schema.get_field_by_name("a").type)
946+
== "list<element: list<element: int64>>"
947+
)
948+
934949

935950
class TestParquetFastParquet(Base):
936951
def test_basic(self, fp, df_full):

0 commit comments

Comments
 (0)