Skip to content

Commit b7da9c5

Browse files
jordan-d-murphypmhatre1
authored andcommitted
DOC: fix PR02 errors in docstring for pandas.io.formats.style.Styler.to_excel (pandas-dev#57230)
1 parent 73cf272 commit b7da9c5

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7171

7272
MSG='Partially validate docstrings (PR02)' ; echo $MSG
7373
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=PR02 --ignore_functions \
74-
pandas.io.formats.style.Styler.to_excel\
7574
pandas.CategoricalIndex.rename_categories\
7675
pandas.CategoricalIndex.reorder_categories\
7776
pandas.CategoricalIndex.add_categories\

pandas/core/generic.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@
220220
from pandas.core.indexers.objects import BaseIndexer
221221
from pandas.core.resample import Resampler
222222

223+
import textwrap
224+
223225
# goal is to be able to define the docs close to function, while still being
224226
# able to share
225227
_shared_docs = {**_shared_docs}
@@ -2240,6 +2242,12 @@ def _repr_data_resource_(self):
22402242
klass="object",
22412243
storage_options=_shared_docs["storage_options"],
22422244
storage_options_versionadded="1.2.0",
2245+
extra_parameters=textwrap.dedent(
2246+
"""\
2247+
engine_kwargs : dict, optional
2248+
Arbitrary keyword arguments passed to excel engine.
2249+
"""
2250+
),
22432251
)
22442252
def to_excel(
22452253
self,
@@ -2315,9 +2323,7 @@ def to_excel(
23152323
{storage_options}
23162324
23172325
.. versionadded:: {storage_options_versionadded}
2318-
engine_kwargs : dict, optional
2319-
Arbitrary keyword arguments passed to excel engine.
2320-
2326+
{extra_parameters}
23212327
See Also
23222328
--------
23232329
to_csv : Write DataFrame to a comma-separated values (csv) file.

pandas/io/formats/style.py

+1
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ def set_tooltips(
516516
klass="Styler",
517517
storage_options=_shared_docs["storage_options"],
518518
storage_options_versionadded="1.5.0",
519+
extra_parameters="",
519520
)
520521
def to_excel(
521522
self,

0 commit comments

Comments
 (0)