Skip to content

Change fname to path in to_parquet #25976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4772,7 +4772,7 @@ Parquet supports partitioning of data based on the values of one or more columns
:okwarning:

df = pd.DataFrame({'a': [0, 0, 1, 1], 'b': [0, 1, 0, 1]})
df.to_parquet(fname='test', engine='pyarrow',
df.to_parquet(path='test', engine='pyarrow',
partition_cols=['a'], compression=None)

The `fname` specifies the parent directory to which data will be saved.
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2076,7 +2076,7 @@ def to_feather(self, fname):
from pandas.io.feather_format import to_feather
to_feather(self, fname)

def to_parquet(self, fname, engine='auto', compression='snappy',
def to_parquet(self, path, engine='auto', compression='snappy',
index=None, partition_cols=None, **kwargs):
"""
Write a DataFrame to the binary parquet format.
Expand All @@ -2090,7 +2090,7 @@ def to_parquet(self, fname, engine='auto', compression='snappy',

Parameters
----------
fname : str
path : str
File path or Root Directory path. Will be used as Root Directory
path while writing a partitioned dataset.

Expand Down Expand Up @@ -2144,7 +2144,7 @@ def to_parquet(self, fname, engine='auto', compression='snappy',
1 2 4
"""
from pandas.io.parquet import to_parquet
to_parquet(self, fname, engine,
to_parquet(self, path, engine,
compression=compression, index=index,
partition_cols=partition_cols, **kwargs)

Expand Down