-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST: Fix doctests in style.py #42759
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
Comments
take |
Styler is a different object to the rest of pandas, its methods affect the visual output of browsers and other renderers. These docstrings were created as a balance between helping the user and being able to read the code as a developer. Adding images has the disadvantage of being more difficult for developers to edit, but being visually accurate. The solution here, as is with many styler doc tests is to skip the doc test, where appropriate. If no output is provided then considerations should be made as to either:
For example |
@attack68 Great observations. I think that all doctests I found in the The methods I have noticed that will need images in your doctests are below:
|
all of those (except pipe) are extensively covered in the The background gradient, in my opinion, is an exception because its docstring shows different combinations of keyword arguments which have different effects, which are not covered in the user guide.
|
@attack68 Great observations. I'll put a link to the |
tl;dr
Fix the numerous doctests that are giving errors in the style.py file:
Detailed instructions
Each of the doctests failed for different reasons. You can see the reason for each of them by running the command below:
In general, the above errors can be fixed with things like:
df
is used, butno sample dataset
df
has been first defined)For example, a function that connects to a private webservice. In
such cases, we can add
# doctest: +SKIP
at the end of the linesthat should not run
involve the styling of a table, it will be necessary to skip the
test (ensuring that it is happening correctly) or use the tag
# doctest: +ELLIPSIS
Observation
In some cases it'll be necessary to use
# doctest: +SKIP
and later in another use or in this same issue, add images for some results that cannot be displayed, such as stylizations and color addition (this was dealt with in another issue).The text was updated successfully, but these errors were encountered: