File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 13
13
FilePathOrBuffer ,
14
14
StorageOptions ,
15
15
)
16
+ from pandas .compat import pa_version_under4p0
16
17
from pandas .compat ._optional import import_optional_dependency
17
18
from pandas .errors import AbstractMethodError
18
19
from pandas .util ._decorators import doc
@@ -179,6 +180,11 @@ def write(
179
180
mode = "wb" ,
180
181
is_dir = partition_cols is not None ,
181
182
)
183
+
184
+ # Output compliant Parquet if PyArrow supports it
185
+ if not pa_version_under4p0 :
186
+ kwargs ["use_compliant_nested_type" ] = True
187
+
182
188
try :
183
189
if partition_cols is not None :
184
190
# writes to multiple files under the given path
@@ -191,9 +197,7 @@ def write(
191
197
)
192
198
else :
193
199
# write to single output file
194
- self .api .parquet .write_table (
195
- table , path_or_handle , compression = compression , ** kwargs
196
- )
200
+ self .api .parquet .write_table (table , path_or_handle , compression = compression , ** kwargs )
197
201
finally :
198
202
if handles is not None :
199
203
handles .close ()
You can’t perform that action at this time.
0 commit comments