-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Update Styler.clear method to clear all #40664
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
Conversation
…cel file, and fixed typo via pandas-dev#38990
…eets.rst Co-authored-by: Aidan Feldman <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good but needs a few changes
.gitignore
Outdated
@@ -119,3 +119,4 @@ doc/build/html/index.html | |||
doc/tmp.sv | |||
env/ | |||
doc/source/savefig/ | |||
virtualenvs/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this addition to the gitignore. it is effective only for your environment.
pandas/io/formats/style.py
Outdated
|
||
self.hidden_index = False | ||
self.hidden_columns = [] | ||
self.tooltips = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.tooltips = None
is already set above and tested for
doc/source/whatsnew/v1.3.0.rst
Outdated
@@ -145,6 +145,7 @@ Other enhancements | |||
- :class:`RangeIndex` can now be constructed by passing a ``range`` object directly e.g. ``pd.RangeIndex(range(3))`` (:issue:`12067`) | |||
- :meth:`round` being enabled for the nullable integer and floating dtypes (:issue:`38844`) | |||
- :meth:`pandas.read_csv` and :meth:`pandas.read_json` expose the argument ``encoding_errors`` to control how encoding errors are handled (:issue:`39450`) | |||
- :meth:`.Styler.clear` now clears :attr:`Styler.hidden_index`, :attr:`Styler.hidden_columns` and :attr:`Styler.tooltips` as well (:issue:`40484`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove tooltips
since it already does this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this user visible at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a user visible change only if:
- the user has a styler which has a hidden index, or hidden columns applied, or both,
- then uses the
clear
method, - then re-renders the Styler
prior to this PR the hidden items would still be hidden, after this PR the styler resets so nothing is hidden.
doc/source/whatsnew/v1.3.0.rst
Outdated
@@ -145,6 +145,7 @@ Other enhancements | |||
- :class:`RangeIndex` can now be constructed by passing a ``range`` object directly e.g. ``pd.RangeIndex(range(3))`` (:issue:`12067`) | |||
- :meth:`round` being enabled for the nullable integer and floating dtypes (:issue:`38844`) | |||
- :meth:`pandas.read_csv` and :meth:`pandas.read_json` expose the argument ``encoding_errors`` to control how encoding errors are handled (:issue:`39450`) | |||
- :meth:`.Styler.clear` now clears :attr:`Styler.hidden_index`, :attr:`Styler.hidden_columns` and :attr:`Styler.tooltips` as well (:issue:`40484`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this user visible at all?
Thank you for the review guys! I'll make the change above. Curious fails in the CI tests yesterday though - was going through some of the logs last night; the errors arose from modules/code lines I didn't touch (pulled from repo :S) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this lgtm
doc/source/whatsnew/v1.3.0.rst
Outdated
@@ -145,6 +145,7 @@ Other enhancements | |||
- :class:`RangeIndex` can now be constructed by passing a ``range`` object directly e.g. ``pd.RangeIndex(range(3))`` (:issue:`12067`) | |||
- :meth:`round` being enabled for the nullable integer and floating dtypes (:issue:`38844`) | |||
- :meth:`pandas.read_csv` and :meth:`pandas.read_json` expose the argument ``encoding_errors`` to control how encoding errors are handled (:issue:`39450`) | |||
- :meth:`.Styler.clear` now clears :attr:`Styler.hidden_index` and :attr:`Styler.hidden_columns` as well (:issue:`40484`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually one minor item: can you move this line up to where the other STyler changes are reported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing, will update in a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great thanks
thanks @bsun94 |
thank you guys for the review! |
Styler
should clear all #40484