Skip to content

Commit 249b43d

Browse files
authored
DOC: Replace @doc decorator with inlined docstrings in pandas/io/parquet.py (#63445)
1 parent 77b7222 commit 249b43d

File tree

1 file changed

+24
-16
lines changed

1 file changed

+24
-16
lines changed

pandas/io/parquet.py

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@
2121
AbstractMethodError,
2222
Pandas4Warning,
2323
)
24-
from pandas.util._decorators import (
25-
doc,
26-
set_module,
27-
)
24+
from pandas.util._decorators import set_module
2825
from pandas.util._validators import check_dtype_backend
2926

3027
from pandas import (
3128
DataFrame,
3229
get_option,
3330
)
34-
from pandas.core.shared_docs import _shared_docs
3531

3632
from pandas.io._util import arrow_table_to_pandas
3733
from pandas.io.common import (
@@ -410,7 +406,6 @@ def read(
410406
handles.close()
411407

412408

413-
@doc(storage_options=_shared_docs["storage_options"])
414409
def to_parquet(
415410
df: DataFrame,
416411
path: FilePath | WriteBuffer[bytes] | None = None,
@@ -430,10 +425,10 @@ def to_parquet(
430425
df : DataFrame
431426
path : str, path object, file-like object, or None, default None
432427
String, path object (implementing ``os.PathLike[str]``), or file-like
433-
object implementing a binary ``write()`` function. If None, the result is
434-
returned as bytes. If a string, it will be used as Root Directory path
435-
when writing a partitioned dataset. The engine fastparquet does not
436-
accept file-like objects.
428+
object implementing a binary ``write()`` function. If None, the result
429+
is returned as bytes. If a string, it will be used as Root Directory
430+
path when writing a partitioned dataset. The engine fastparquet does
431+
not accept file-like objects.
437432
engine : {{'auto', 'pyarrow', 'fastparquet'}}, default 'auto'
438433
Parquet library to use. If 'auto', then the option
439434
``io.parquet.engine`` is used. The default ``io.parquet.engine``
@@ -460,8 +455,15 @@ def to_parquet(
460455
Column names by which to partition the dataset.
461456
Columns are partitioned in the order they are given.
462457
Must be None if path is not a string.
463-
{storage_options}
464-
458+
storage_options : dict, optional
459+
Extra options that make sense for a particular storage connection, e.g.
460+
host, port, username, password, etc. For HTTP(S) URLs the key-value
461+
pairs are forwarded to ``urllib.request.Request`` as header options.
462+
For other URLs (e.g. starting with "s3://", and "gcs://") the
463+
key-value pairs are forwarded to ``fsspec.open``. Please see ``fsspec``
464+
and ``urllib`` for more details, and for more examples on storage
465+
options refer `here <https://pandas.pydata.org/docs/user_guide/io.html?
466+
highlight=storage_options#reading-writing-remote-files>`_.
465467
filesystem : fsspec or pyarrow filesystem, default None
466468
Filesystem object to use when reading the parquet file. Only implemented
467469
for ``engine="pyarrow"``.
@@ -504,7 +506,6 @@ def to_parquet(
504506

505507

506508
@set_module("pandas")
507-
@doc(storage_options=_shared_docs["storage_options"])
508509
def read_parquet(
509510
path: FilePath | ReadBuffer[bytes],
510511
engine: str = "auto",
@@ -547,8 +548,15 @@ def read_parquet(
547548
if you wish to use its implementation.
548549
columns : list, default=None
549550
If not None, only these columns will be read from the file.
550-
{storage_options}
551-
551+
storage_options : dict, optional
552+
Extra options that make sense for a particular storage connection, e.g.
553+
host, port, username, password, etc. For HTTP(S) URLs the key-value
554+
pairs are forwarded to ``urllib.request.Request`` as header options.
555+
For other URLs (e.g. starting with "s3://", and "gcs://") the
556+
key-value pairs are forwarded to ``fsspec.open``. Please see ``fsspec``
557+
and ``urllib`` for more details, and for more examples on storage
558+
options refer `here <https://pandas.pydata.org/docs/user_guide/io.html?
559+
highlight=storage_options#reading-writing-remote-files>`_.
552560
dtype_backend : {{'numpy_nullable', 'pyarrow'}}
553561
Back-end data type applied to the resultant :class:`DataFrame`
554562
(still experimental). If not specified, the default behavior
@@ -609,7 +617,7 @@ def read_parquet(
609617
610618
Examples
611619
--------
612-
>>> original_df = pd.DataFrame({{"foo": range(5), "bar": range(5, 10)}})
620+
>>> original_df = pd.DataFrame({"foo": range(5), "bar": range(5, 10)})
613621
>>> original_df
614622
foo bar
615623
0 0 5

0 commit comments

Comments
 (0)