-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix Excel-specific border styles #48660
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
Let me know if the behavior change for unspecified colors is too much for a minor version. The new behavior matches CSS behavior so it follows the more expected behavior and will have more consistency between |
doc/source/whatsnew/v1.5.1.rst
Outdated
@@ -23,7 +23,8 @@ Fixed regressions | |||
|
|||
Bug fixes | |||
~~~~~~~~~ | |||
- | |||
- Bug in :class:`CSSToExcelConverter` leading to error when unrecognized ``border-style`` (including ``"hair"``) provided to Excel writers (:issue:`48649`) |
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 would slightly learn toward moving this to v1.6.0.rst
as it appears this was "unsupported" rather than "use to work"
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 could support either, but to play devil's advocate: pandas never specified that these particular border-styles were supported or unsupported. The closest thing to documentation was this comment block in _border_style
which implies there is a path to getting the "hair" style (as well as "mediumDashDot", "slantDashDot", "dashDot", and "dashDotDot") when one didn't actually exist:
# convert styles and widths to openxml, one of:
# 'dashDot'
# 'dashDotDot'
# 'dashed'
# 'dotted'
# 'double'
# 'hair'
# 'medium'
# 'mediumDashDot'
# 'mediumDashDotDot'
# 'mediumDashed'
# 'slantDashDot'
# 'thick'
# 'thin'
I think the error when using xlsxwriter
with an unsupported border-style should be fixed in v1.5.1 (i.e. return "none"
at end of function), as the stack location and error message make it very unclear where the user has introduced the error. And if we're fixing that, then it's pretty small step from there to add the support for the other styles.
I definitely think I'm onboard with removing the color defaulting portion from a v1.5.1 and moving it to a separate PR for v1.6.0
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 think the error when using
xlsxwriter
with an unsupported border-style should be fixed in v1.5.1 (i.e.return "none"
at end of function), as the stack location and error message make it very unclear where the user has introduced the error.
The criteria for whether something should go in a patch or minor version is "did it work before". That is, patch releases should only fix regressions. As this isn't a regression, I'm also +1 on putting this in 1.6.0.
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 suggest that if border-style
attribute was supported for some styles, in v1.5.0, one should, by extension, assume that all the different border-style
values were supported without their explicit documentation. And a failing to not support certain values is either a bug in the code or a bug in the documentation. I support 1.5.1.
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.
Okay given the reduced scope (removing the color defaulting). I would be okay with 1.5.1
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 great!
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.
lgtm
Caught and fixed a bug when using these styles in the border shorthand (e.g. |
looks good, can you merge main |
@attack68 |
@rhshadrach merging is blocked here. are we missing unaddressed requests? also is the pull request reflecting the right branch. im not up to speed with current 2.0 or 1.5.2 route? |
Thanks for the ping - I've dismissed my stale review as the changes were made, so it's no longer blocking.
In either case, we'll merge into main first and then backport if it should go into 1.5.2. As long as it's tagged with the 1.5.2 milestone, the backport will be attempted by meeseeks. The discussion of which to do is here: #48660 (comment) |
@mroeschke are you ok with this? If so I think its OK to merge. |
It seems 1.5.2 si ready for release, this seems to have been pushed to 1.5.3, can you update the whatrs new |
@attack68 Merged from main and moved the whatsnew entry to 1.5.3. It should be good to go assuming tests pass |
@mroeschke you happy also if we merge this? |
Sorry for the delay on my end, thanks @tehunter for sticking with it |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
df.to_excel
fails for"border-style: hair"
withxlsxwriter
#48649Added type annotations to new arguments/methods/functions.doc/source/whatsnew/v1.5.1.rst
doc/source/whatsnew/v1.5.2.rst
file if fixing a bug or adding a new feature.Fixes Excel-specific border styles
and modifies behavior whenborder-style
provided without aborder-color
to match CSS behavior (i.e., defaults to black)