-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
EHN: df.to_latex(escape=True)
also escape index names
#61307
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
base: main
Are you sure you want to change the base?
EHN: df.to_latex(escape=True)
also escape index names
#61307
Conversation
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.
Thanks for the PR!
@@ -824,6 +824,33 @@ def test_to_latex_escape_special_chars(self): | |||
) | |||
assert result == expected | |||
|
|||
def test_to_latex_escape_special_chars_in_index_names(self): | |||
special_characters = ["&", "%", "$", "#", "_", "{", "}", "~", "^", "\\"] |
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.
Can you start the first line of the test with a reference to the issue:
# https://github.com/pandas-dev/pandas/issues/61309
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.
added
@@ -824,6 +824,33 @@ def test_to_latex_escape_special_chars(self): | |||
) | |||
assert result == expected | |||
|
|||
def test_to_latex_escape_special_chars_in_index_names(self): |
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.
I'm seeing this test pass on main.
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.
oops, my bad. fixed
cc @attack68 as the codeowner of styler |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.Stage 3. Part of an multi-stages effort: #57880 (comment)
Part 2 has a issue at #59324
But in the process of implementing, I realized the current implementation of
df.to_latex(escape)
does not go throughstyler.to_latex
but to callstyler.format_index
. This implementation follows the same flow. So maybe part 2 is not really relevant.