Skip to content
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

DOC: fix docstring validation errors for pandas.io.formats.style.Styler #59607

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

hlakams
Copy link
Contributor

@hlakams hlakams commented Aug 26, 2024

Addresses #59606.

Fixes:

pandas/ci/code_checks.sh

Lines 308 to 335 in 360597c

-i "pandas.io.formats.style.Styler.apply RT03" \
-i "pandas.io.formats.style.Styler.apply_index RT03" \
-i "pandas.io.formats.style.Styler.background_gradient RT03" \
-i "pandas.io.formats.style.Styler.bar RT03,SA01" \
-i "pandas.io.formats.style.Styler.clear SA01" \
-i "pandas.io.formats.style.Styler.concat RT03,SA01" \
-i "pandas.io.formats.style.Styler.export RT03" \
-i "pandas.io.formats.style.Styler.from_custom_template SA01" \
-i "pandas.io.formats.style.Styler.hide RT03,SA01" \
-i "pandas.io.formats.style.Styler.highlight_between RT03" \
-i "pandas.io.formats.style.Styler.highlight_max RT03" \
-i "pandas.io.formats.style.Styler.highlight_min RT03" \
-i "pandas.io.formats.style.Styler.highlight_null RT03" \
-i "pandas.io.formats.style.Styler.highlight_quantile RT03" \
-i "pandas.io.formats.style.Styler.map RT03" \
-i "pandas.io.formats.style.Styler.map_index RT03" \
-i "pandas.io.formats.style.Styler.set_caption RT03,SA01" \
-i "pandas.io.formats.style.Styler.set_properties RT03,SA01" \
-i "pandas.io.formats.style.Styler.set_sticky RT03,SA01" \
-i "pandas.io.formats.style.Styler.set_table_attributes PR07,RT03" \
-i "pandas.io.formats.style.Styler.set_table_styles RT03" \
-i "pandas.io.formats.style.Styler.set_td_classes RT03" \
-i "pandas.io.formats.style.Styler.set_tooltips RT03,SA01" \
-i "pandas.io.formats.style.Styler.set_uuid PR07,RT03,SA01" \
-i "pandas.io.formats.style.Styler.text_gradient RT03" \
-i "pandas.io.formats.style.Styler.to_excel PR01" \
-i "pandas.io.formats.style.Styler.to_string SA01" \
-i "pandas.io.formats.style.Styler.use RT03" \

Note: order of args for pandas.io.formats.style.Styler.to_excel shifted around in order to maintain compatibility with shared doc template handler.

@@ -553,11 +576,11 @@ def to_excel(
startcol: int = 0,
engine: str | None = None,
merge_cells: ExcelWriterMergeCells = True,
encoding: str | None = None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ordering of these parameters should not change.

Copy link
Contributor Author

@hlakams hlakams Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function's parameters are out of order when used in the base to_excel template docstring (since var extra_parameters is substituted at its end). I'll roll back the current change and instead add optional params to the base to_excel template docstring to accommodate encoding and verbose.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolution for requested change is in 175dd36.

@mroeschke mroeschke added the Docs label Aug 26, 2024
@hlakams hlakams force-pushed the fix_docstring_pandas_styler branch from 6eb9be1 to 175dd36 Compare August 26, 2024 20:49
@hlakams hlakams requested a review from mroeschke August 26, 2024 21:34
@mroeschke mroeschke added this to the 3.0 milestone Aug 27, 2024
@mroeschke mroeschke merged commit 7c36579 into pandas-dev:main Aug 27, 2024
47 checks passed
@mroeschke
Copy link
Member

Thanks @hlakams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants