Skip to content

ENH: Styler css Str optional input arguments as well as List[Tuple] #39564

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 13 commits into from
Feb 5, 2021

Conversation

attack68
Copy link
Contributor

@attack68 attack68 commented Feb 2, 2021

@attack68
Copy link
Contributor Author

attack68 commented Feb 4, 2021

this is ready for review..

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

looks fine. couple of comments.


def _maybe_convert_css_to_tuples(
style: Union[str, Sequence[Tuple[str, Union[str, int, float]]]]
):
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add an output type (maybe define this at the top as CSSProperties or similar)

@@ -56,6 +56,7 @@ Other enhancements
- :meth:`.Styler.set_tooltips` allows on hover tooltips to be added to styled HTML dataframes.
- :meth:`Series.loc.__getitem__` and :meth:`Series.loc.__setitem__` with :class:`MultiIndex` now raising helpful error message when indexer has too many dimensions (:issue:`35349`)
- :meth:`pandas.read_stata` and :class:`StataReader` support reading data from compressed files.
- :meth:`.Styler.set_tooltips_class` and :meth:`.Styler.set_table_styles` amended to optionally allow certain css-string input arguments.
Copy link
Contributor

Choose a reason for hiding this comment

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

locate after the other note, L56 (which is missing an issue number; use the PR number for it)

@jreback jreback added the Styler conditional formatting using DataFrame.style label Feb 4, 2021
@jreback jreback added this to the 1.3 milestone Feb 4, 2021
@attack68
Copy link
Contributor Author

attack68 commented Feb 4, 2021

@jreback changes made, with some better typing throughout the module.

one failed test is unrelated.

@attack68 attack68 requested a review from jreback February 4, 2021 21:47
@jreback jreback merged commit f02d4cc into pandas-dev:master Feb 5, 2021
@jreback
Copy link
Contributor

jreback commented Feb 5, 2021

thanks @attack68 keep em coming!

@attack68 attack68 deleted the styler_css_strings branch February 5, 2021 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Styler conditional formatting using DataFrame.style
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: Styler accepts css-strings input args as well as list of (attr,value) pairs
2 participants