-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Error in read_excel() function with some ods files #45598
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
Comments
Thanks for the report - can you provide a sample file? |
Of course! sample.ods |
Thanks for the sample file - as far as I can tell as long as the XML is valid, it satisfies the format for ODS, and the sample file contains valid XML. Agreed this should be fixed, are you interested in putting up a PR @f4kt? |
By these days I'm too busy for that, Richard, but thanks in advance for the offer :) |
Hello @rhshadrach I am intrested in contributing to pandas, so can I take this issue, since it is still open? If you have any suggestions in mind please let me know! |
take |
Hello @f4kt if you can provide me a sample file with just a 3x3 table, it would be perfect for the test case I wanna add. |
* BUG: error in read_excel with some ods files #45598 * BUG: use hasattr instead of dir * DOC: add issue number in new test case * DOC: remove comment Co-authored-by: Dimitra Karadima <[email protected]>
…-dev#46050) * BUG: error in read_excel with some ods files pandas-dev#45598 * BUG: use hasattr instead of dir * DOC: add issue number in new test case * DOC: remove comment Co-authored-by: Dimitra Karadima <[email protected]>
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
When taking an ods file generated from qgis (exporting a vector layer in ods format), its content.xml (internal file from ods) has newlines between XML elements, like this:
instead of being like this:
then if I open with LibreOffice calc that file it's ok, but when doing:
then there is this traceback:
Solution:
rewrite line no. 103 of https://github.com/pandas-dev/pandas/blob/main/pandas/io/excel/_odfreader.py
Expected Behavior
The expected behaviour is to ignore the newlines. LibreOffice calc opens correctly that kind of ods
Installed Versions
The text was updated successfully, but these errors were encountered: