Skip to content

Commit 3ee2f11

Browse files
committed
Write compliant Parquet with pyarrow if supported
1 parent ef97dd4 commit 3ee2f11

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/io/parquet.py

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
FilePathOrBuffer,
1414
StorageOptions,
1515
)
16+
from pandas.compat import pa_version_under4p0
1617
from pandas.compat._optional import import_optional_dependency
1718
from pandas.errors import AbstractMethodError
1819
from pandas.util._decorators import doc
@@ -179,6 +180,11 @@ def write(
179180
mode="wb",
180181
is_dir=partition_cols is not None,
181182
)
183+
184+
# Output compliant Parquet if PyArrow supports it
185+
if not pa_version_under4p0:
186+
kwargs["use_compliant_nested_type"] = True
187+
182188
try:
183189
if partition_cols is not None:
184190
# writes to multiple files under the given path

0 commit comments

Comments
 (0)