Skip to content
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

BUG: error in read_excel with some ods files #45598 #46050

Merged
merged 6 commits into from
Mar 3, 2022

Conversation

dimitra-karadima
Copy link
Contributor

@dimitra-karadima dimitra-karadima commented Feb 18, 2022

sheet_cells = [
x
for x in sheet_row.childNodes
if "qname" in dir(x) and x.qname in cell_names
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do getattr(x, "qname")?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phofl The tests are passing only with if "qname" in dir(x) and getattr(x, "qname") in cell_names. But I don't know if that's what you meant.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use hasattr not dir

@jreback jreback added the IO Excel read_excel, to_excel label Feb 27, 2022
sheet_cells = [
x
for x in sheet_row.childNodes
if "qname" in dir(x) and x.qname in cell_names
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use hasattr not dir

@jreback jreback added this to the 1.5 milestone Mar 1, 2022
@jreback
Copy link
Contributor

jreback commented Mar 1, 2022

cc @phofl @rhshadrach

Copy link
Member

@phofl phofl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small comment, otherwise lgtm



def test_read_newlines_between_xml_elements_table():
# Also test reading table from an text OpenDocument file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add gh reference with GH#number

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don‘t need the comment, the reference is enough

Copy link
Contributor Author

@dimitra-karadima dimitra-karadima Mar 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phofl Done! But thanks! Good to know for my next PRs!

Copy link
Member

@rhshadrach rhshadrach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - pending @phofl's request.

@phofl phofl merged commit 004b4c5 into pandas-dev:main Mar 3, 2022
@phofl
Copy link
Member

phofl commented Mar 3, 2022

Thx @dimitra-karadima

yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
…-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 <dkaradima@convertgroup.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Excel read_excel, to_excel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Error in read_excel() function with some ods files
4 participants