-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Styler Types for CSS variables on ctx
object.
#39660
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
# Conflicts: # pandas/tests/io/formats/test_style.py
looks reasonable. is there any user facing change here? |
# Conflicts: # pandas/io/formats/style.py
@jreback shouldn't have any user facing changes. A quick question if you have time: what is the style guideline for |
the entire module should be private as pandas.core is indicated as private. Generally leading underscores are useful to indicate that this function is not used outside of the module. But wouldn't simply change things as that causes huge diffs for no reason. |
ah I just thought of a change (demonstrated by the what_new_0.20.0 file). If the user has code which generated bad-css that was previously silently ignored, it will now raise an error. maybe we need a call on whether raising or silently ignoring is better?? |
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.
assume no changes in performance? (I think we have a couple of benchmarks)
BENCHMARKS NOT SIGNIFICANTLY CHANGED. |
thanks @attack68 |
Hi, when styling Excel sheets (using It's common for these formats to include one, or multiple, semicolons since this is how Excel defines styles for positive/negative numbers (ie. For now my processes will be pinned on pandas 1.2.x, but would love to look into how this could be fixed. Thanks |
Styler
currently has three formats for keeping track of CSS:A)
CSSList type: [('a1', 'v1'), ('a2', 'v2')]
B)
List[str] type: ['a1:v1', 'a2:v2']
C)
Str type: 'a1:v1; a2:v2;'
C
is only ever used as user input format, and now, as of #39564C
can be used in all cases for user input (albeitA
remains available for backwards compatibility in.set_table_styles()
)A
remains the most algorithimcally accessible, and is whatC
is already converted to in some cases for internal variables.B
is only ever used by one internal variable. Thectx
object is updated withB
type converted fromC
. For final render thisB
type is converted toA
type for looping. In the process, white space is poorly handled.This PR eliminates
B
type and convertsC
directly toA
.Tests using the
ctx
object needed updating for new type.