Skip to content

Commit

Permalink
DOC: fix PR02 errors in docstring for pandas.io.formats.style.Styler.…
Browse files Browse the repository at this point in the history
…to_excel (#57230)
  • Loading branch information
jordan-d-murphy authored Feb 4, 2024
1 parent 94d575a commit 937335f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Partially validate docstrings (PR02)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=PR02 --ignore_functions \
pandas.io.formats.style.Styler.to_excel\
pandas.CategoricalIndex.rename_categories\
pandas.CategoricalIndex.reorder_categories\
pandas.CategoricalIndex.add_categories\
Expand Down
12 changes: 9 additions & 3 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@
from pandas.core.indexers.objects import BaseIndexer
from pandas.core.resample import Resampler

import textwrap

# goal is to be able to define the docs close to function, while still being
# able to share
_shared_docs = {**_shared_docs}
Expand Down Expand Up @@ -2240,6 +2242,12 @@ def _repr_data_resource_(self):
klass="object",
storage_options=_shared_docs["storage_options"],
storage_options_versionadded="1.2.0",
extra_parameters=textwrap.dedent(
"""\
engine_kwargs : dict, optional
Arbitrary keyword arguments passed to excel engine.
"""
),
)
def to_excel(
self,
Expand Down Expand Up @@ -2315,9 +2323,7 @@ def to_excel(
{storage_options}
.. versionadded:: {storage_options_versionadded}
engine_kwargs : dict, optional
Arbitrary keyword arguments passed to excel engine.
{extra_parameters}
See Also
--------
to_csv : Write DataFrame to a comma-separated values (csv) file.
Expand Down
1 change: 1 addition & 0 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ def set_tooltips(
klass="Styler",
storage_options=_shared_docs["storage_options"],
storage_options_versionadded="1.5.0",
extra_parameters="",
)
def to_excel(
self,
Expand Down

0 comments on commit 937335f

Please sign in to comment.