Open rhshadrach-8451 opened 2 days ago
Thanks. That is a bug.
The library doesn't allow 2 worksheet autofilters (since Excel doesn't allow it) but it doesn't prevent a worksheet autofilter and a table autofilter from overlapping (which it should do). I'll fix that.
Thanks for the detailed report.
Current behavior
In converting code from pandas to Polars, I neglected to see that Polars adds autofilters by default in write_excel. My prior code was adding autofilters manually via xlsxwriter. Thus switching to Polars, autofilters were being added twice. The Python code ran fine, but when opening the resulting workbook Excel needed to repair the file. The log stated:
Took me a bit to figure out what was going on.
Expected behavior
Not necessarily expected, but perhaps more desirable would be for xlsxwriter to detect the situation (assuming my diagnosis is correct - which I am not certain of) and raise an informative error message.
Not sure if this is feasible - if it isn't, then I thought just having this (closed) issue with the error message would possibly let others stumble upon a potential somewhat common case (switching from pandas to Polars).
Sample code to reproduce
Environment
Any other information
This might be similar to:
999
739
OpenOffice and LibreOffice users