BUG/ENH: Translate CSS border properties for Styler.to_excel
by tehunter · Pull Request #45312 · pandas-dev/pandas (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation34 Commits30 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
- checks an item on BUG: Styler.to_excel does not export styles and formats correctly #42276 ("Border styles bug")
- tests added / passed
- Ensure all linting tests pass, see here for how to run them
- whatsnew entry
Hello @tehunter! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻
Comment last updated at 2022-02-10 13:27:41 UTC
This comment has been minimized.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you also look to add a roundtrip test in pandas/tests/io/excel/test_style.py
Addressing PR change requests
Any idea what could be causing the failure? It's something related to filesystems in test_arrowparquet_options
, which I haven't touched.
Looking really good, especially the style round trip. Just one or two comments for optimisation.
Co-authored-by: JHM Darbyshire 24256554+attack68@users.noreply.github.com
can you show a test that exerices this at a high level as well
Its difficult to test this since you have to write to excel and then read that the file rendered correctly.
The round trip tests I requested in test_style.py
now do this: explicitly they check that:
a) The styled dataframe (with a border) is different to the unstyled dataframe (without border)
b) that the excel file created is read in correctly by openpyxl and has the border styles as expected.
needs a whats new 1.5.0, (maybe 1.4.1 if it can be backported).
Do I write the entry or does a maintainer do that? I propose 2 entries along the lines of:
- Bug Fix: Fixed bug in
CSSToExcelConverter
leading toTypeError
when border color provided without border style forxlsxwriter
engine (GH42276) - Enhancement / Styler Enhancements: Added the ability to render
border
andborder-{side}
CSS properties in Excel (GH42276)
looks fine (but before i resolved i think the doc-build was failing) so let's check that.
Co-authored-by: JHM Darbyshire 24256554+attack68@users.noreply.github.com
Co-authored-by: JHM Darbyshire 24256554+attack68@users.noreply.github.com
@github-actions pre-commit
@tehunter if you get a chance to merge with main, i can take a look at the CI errors you are getting
Styler |
---|
^^^^^^ |
- Fixed bug in :class:`CSSToExcelConverter` leading to ``TypeError`` when border color provided without border style for ``xlsxwriter`` engine (:issue:`42276`) |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just put this in the I/O section
phofl pushed a commit to phofl/pandas that referenced this pull request
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request
Labels
read_excel, to_excel
conditional formatting using DataFrame.style