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

Fixed docstring error with style.py, unknown parameter: {'text_color_threshold'} #48055

Merged

Conversation

joshuabello2550
Copy link
Contributor

@joshuabello2550 joshuabello2550 commented Aug 12, 2022

When you run python ./scripts/validate_docstrings.py --errors=PR02, one of the errors is /home/pandas/pandas/io/formats/style.py:3144:PR02:pandas.io.formats.style.Styler.text_gradient:Unknown parameters {'text_color_threshold'}

The error I believe was because the function text_gradient was using the doc-string for background gradient, which had text_color_threshold as one of the parameters, so validate doc-string expected text_gradient to also have text_color_threshold, even though that parameter was not intended for text_gradient.

@attack68
Copy link
Contributor

this looks good pending the checks and also have you rendered the docs, does it all display OK?

@mroeschke mroeschke added Docs Styler conditional formatting using DataFrame.style labels Aug 12, 2022
@joshuabello2550 joshuabello2550 changed the title Fixed docstring error with style.py, unknown parameter: text_color_threshold Fixed docstring error with style.py, unknown parameter: {'text_color_threshold'} Aug 12, 2022
@joshuabello2550
Copy link
Contributor Author

Hi, I don't believe the changes I have made, contributed to the errors in the checks. Could you please clarify?

Copy link
Contributor

@attack68 attack68 left a comment

Choose a reason for hiding this comment

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

yes the test failures are unrelated

low=low,
high=high,
axis=axis,
Copy link
Member

Choose a reason for hiding this comment

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

Why did this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No real reason, I believe I was trying to match the order of the parameters in the docstring.

Copy link
Member

Choose a reason for hiding this comment

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

Mind reverting this change for now (could be a follow up PR)? We want to avoid any potential unrelated behavior change as this was supposed to just adjust a docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a valid change, but can be easier to add it in a separate taregted PR after this one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

reverted the unnecessary changes

reverted unneeded changes
Revert unneeded changes
@mroeschke mroeschke added this to the 1.5 milestone Aug 18, 2022
@mroeschke mroeschke merged commit 8819247 into pandas-dev:main Aug 18, 2022
@mroeschke
Copy link
Member

Thanks @joshuabello2550

noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
…threshold'} (pandas-dev#48055)

* fixed docstring error with style.py unknown paramter 'text_color_threshold'

* Fixed docstring error with style.py, unknown parameter: text_color_threshold

* Update style.py

reverted unneeded changes

* Update style.py

Revert unneeded changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Docs Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants