Skip to content

Commit 229c9c1

Browse files
committed
Merge branch 'DOCS---Ambiguous-description-in-pandas.DataFrame.to_parquet-documentation-pandas-dev#19662'
2 parents 375c68d + 8414a1f commit 229c9c1

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

pandas/core/frame.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1678,9 +1678,10 @@ def to_parquet(self, fname, engine='auto', compression='snappy',
16781678
fname : str
16791679
string file path
16801680
engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto'
1681-
Parquet reader library to use. If 'auto', then the option
1682-
'io.parquet.engine' is used. If 'auto', then the first
1683-
library to be installed is used.
1681+
Parquet library to use. If 'auto', the value from
1682+
``io.parquet.engine`` is used. The default ``io.parquet.engine``
1683+
behavior is to try 'pyarrow', falling back to 'fastparquet' if
1684+
'pyarrow' is unavailable.
16841685
compression : {'snappy', 'gzip', 'brotli', None}, default 'snappy'
16851686
Name of the compression to use. Use ``None`` for no compression.
16861687
kwargs
@@ -2614,7 +2615,7 @@ def _ensure_valid_index(self, value):
26142615
if not len(self.index) and is_list_like(value):
26152616
try:
26162617
value = Series(value)
2617-
except:
2618+
except ValueError:
26182619
raise ValueError('Cannot set a frame with no defined index '
26192620
'and a value that cannot be converted to a '
26202621
'Series')

pandas/io/parquet.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,10 @@ def to_parquet(df, path, engine='auto', compression='snappy', **kwargs):
236236
path : string
237237
File path
238238
engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto'
239-
Parquet reader library to use. If 'auto', then the option
240-
'io.parquet.engine' is used. If 'auto', then the first
241-
library to be installed is used.
239+
Parquet library to use. If 'auto', the value from
240+
``io.parquet.engine`` is used. The default ``io.parquet.engine``
241+
behavior is to try 'pyarrow', falling back to 'fastparquet' if
242+
'pyarrow' is unavailable.
242243
compression : {'snappy', 'gzip', 'brotli', None}, default 'snappy'
243244
Name of the compression to use. Use ``None`` for no compression.
244245
kwargs
@@ -263,9 +264,10 @@ def read_parquet(path, engine='auto', columns=None, **kwargs):
263264
264265
.. versionadded 0.21.1
265266
engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto'
266-
Parquet reader library to use. If 'auto', then the option
267-
'io.parquet.engine' is used. If 'auto', then the first
268-
library to be installed is used.
267+
Parquet library to use. If 'auto', the value from
268+
``io.parquet.engine`` is used. The default ``io.parquet.engine``
269+
behavior is to try 'pyarrow', falling back to 'fastparquet' if
270+
'pyarrow' is unavailable.
269271
kwargs are passed to the engine
270272
271273
Returns

0 commit comments

Comments
 (0)