Skip to content

TST: Fix doctests in style.py #42783

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

Merged
merged 22 commits into from
Jul 31, 2021

Conversation

Leonardofreua
Copy link
Contributor

The following commits fix the doctests of the style.py, add some redirects to the User Guide, and some expected results.

* Modified: pandas/io/formats/style.py

* Added some expected results

* Skipped some tests
* Modified style.py

* Updated the doctest of the apply()

* Updated the doctest of the applymap()

* Updated the doctest of the set_table_styles()

* Updated the doctest of the set_properties()
* Modified style.py

* Updated the doctest of the pipe()
@jreback jreback added Docs Testing pandas testing functions or related to the test suite labels Jul 28, 2021
@jreback jreback added this to the 1.4 milestone Jul 28, 2021
@jreback
Copy link
Contributor

jreback commented Jul 28, 2021

wow

cc @attack68 if you'd take a look / merge (ok if it needs a followup) as this is green.

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.

Thanks for this. Good work.
I have made some comments where I think additions do not benefit the overall purpose of the the documentation. Any skips I left uncommented are welcomed.

@attack68 attack68 added the Styler conditional formatting using DataFrame.style label Jul 29, 2021
@Leonardofreua Leonardofreua changed the title TST: Fix doctests in style.py TST: Fix doctests in style.py Jul 29, 2021
@attack68
Copy link
Contributor

once you are confident that this fixes all cases in style.py do add it to ci/code_checks.ch which will then prevent anyone (like me) adding failing doctests in the future unknowingly.

@jreback
Copy link
Contributor

jreback commented Jul 29, 2021

also pls rebase, in theory this should be all green.

Leonardofreua and others added 17 commits July 30, 2021 13:05
* Modified pandas/io/formats/style.py

* Updated the doctests of the set_tooltips()

* Updated the doctests of the to_latex()

* Updated the doctests of the set_td_classes()

* Updated the doctests of the set_table_attributes()
…andas-dev#42690)

* REGR: ValueError raised when both prefix and names are set to None

* Update readers.py

* whitespace

* Update v1.3.1.rst

* Update v1.3.2.rst

* Update readers.py

* Update readers.py

Co-authored-by: Jeff Reback <[email protected]>
@Leonardofreua
Copy link
Contributor Author

By the time I went to update my branch before committing to the new changes, I ended up rebasing and there were some commits that shouldn't go. I think it will be necessary to make a new, more organized PR, correct?

@Leonardofreua Leonardofreua requested a review from attack68 July 30, 2021 18:12
@jreback
Copy link
Contributor

jreback commented Jul 30, 2021

the failure is fine (its already fixed on master).

@attack68 merge when ready.

@attack68 attack68 merged commit 7963422 into pandas-dev:master Jul 31, 2021
@attack68
Copy link
Contributor

@Leonardofreua thanks. You might want to do a follow-on where the links you added to table visualization are more specific. You can link to specific parts of the page using #page-id-as-title

@Leonardofreua
Copy link
Contributor Author

@Leonardofreua thanks. You might want to do a follow-on where the links you added to table visualization are more specific. You can link to specific parts of the page using #page-id-as-title

Hi @attack68, thanks for the tip. I had initially done just that, but I thought it might not be accepted, so I ended up removing it. Can I open another issue to make this change?

@Leonardofreua Leonardofreua deleted the fix-style-doctests branch July 31, 2021 17:33
feefladder pushed a commit to feefladder/pandas that referenced this pull request Sep 7, 2021
* TST: Fix doctests for pandas.io.formats.style

* Modified: pandas/io/formats/style.py

* Added some expected results

* Skipped some tests

* TST: Add link to redirect to Table Visualization user guide

* Modified style.py

* Updated the doctest of the apply()

* Updated the doctest of the applymap()

* Updated the doctest of the set_table_styles()

* Updated the doctest of the set_properties()

* TST: Add image to pipe function result

* Modified style.py

* Updated the doctest of the pipe()

* TST: Remove unnecessary outputs

* Modified pandas/io/formats/style.py

* Updated the doctests of the set_tooltips()

* Updated the doctests of the to_latex()

* Updated the doctests of the set_td_classes()

* Updated the doctests of the set_table_attributes()

* TST: Add the output to the Styler.format doctest in to_latex()

* REG: DataFrame.agg where func returns lists and axis=1 (pandas-dev#42762)

* Fix typing issues for CI (pandas-dev#42770)

* BUG: groupby.shift returns different columns when fill_value is specified (pandas-dev#41858)

* PERF: extract_array earlier in DataFrame construction (pandas-dev#42774)

* ENH: `sparse_columns` and `sparse_index` added to `Styler.to_html`  (pandas-dev#41946)

* TYP: Fix typing for searchsorted (pandas-dev#42788)

* DOC GH42756 Update documentation for pandas.DataFrame.drop to clarify tuples. (pandas-dev#42789)

* CI: Fix doctests (pandas-dev#42790)

* REGR: nanosecond timestamp comparisons to OOB datetimes (pandas-dev#42796)

* COMPAT: MPL 3.4.0 (pandas-dev#42803)

* Delete duplicates and unused code from reshape tests (pandas-dev#42802)

* REGR: ValueError raised when both prefix and names are set to None (pandas-dev#42690)

* REGR: ValueError raised when both prefix and names are set to None

* Update readers.py

* whitespace

* Update v1.3.1.rst

* Update v1.3.2.rst

* Update readers.py

* Update readers.py

Co-authored-by: Jeff Reback <[email protected]>

* TST: Add style.py to the doctest check

* TST: fixed eng_formatter doctest for pandas-dev#42671 (pandas-dev#42705)

* TST: Revert x and y position in some doctests

* Updated the doctest of the hide_columns()

Co-authored-by: Richard Shadrach <[email protected]>
Co-authored-by: Irv Lustig <[email protected]>
Co-authored-by: Thomas Smith <[email protected]>
Co-authored-by: jbrockmendel <[email protected]>
Co-authored-by: attack68 <[email protected]>
Co-authored-by: Mike Phung <[email protected]>
Co-authored-by: Matthew Zeitlin <[email protected]>
Co-authored-by: Thomas Li <[email protected]>
Co-authored-by: Patrick Hoefler <[email protected]>
Co-authored-by: Jeff Reback <[email protected]>
Co-authored-by: Krishna Chivukula <[email protected]>
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 Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TST: Fix doctests in style.py