Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Decouple xlrd reading from ExcelFile class #24423
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
Decouple xlrd reading from ExcelFile class #24423
Changes from 1 commit
d015b12
351abae
2dddf18
d2e4174
89a1ebe
607dbe5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
were these just missing?
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.
Also somewhat of a misleading diff but the existing code base has different signatures for
parse
and_parse_excel
. When I moved the latter to be part of the reader class and renamed to simplyparse
git picked it up the different signatures in the diff.I didn't bother to align the signatures here but certainly can as well
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.
Sorry if this is a duplicate (can't see my previous response?) but the diff here is somewhat misleading. Previously there was a
parse
and_parse_excel
function. With the refactor, I moved_parse_excel
to the private reader class but simply named itparse
.Git is mixing up the two
parse
functions, basically assuming that the existing one for theExcelFile
class is brand new (which it wasn't) and is comparing the reader's implementation to the existingExcelFile
class function. The signatures weren't aligned hence this small diff.I just moved the code without any change but can look at aligning signatures if you'd like
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.
can we now renove the kwds?
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.
Will double check. There is one branch where these would get used and dispatched to the
TextParser
, though maybe that is dead codeThere 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.
**kwds
is passed throughTextParser
to the Python parser inparsers.py
.This is definitely not dead code, so I am very wary of removing this. I think some more work can be done to better align the signature
read_excel
with that ofread_csv
(in the interest of creating a more unified data IO API)IMO we should refrain from removing it (that would be an API IMO), especially as there is enough happening with the refactor.
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.
Yea after taking another look agreed with @gfyoung here. I think it's worth aligning the signatures of the different parse calls within the module and potentially removing keyword args if possible (I'm not actually sure what keywords would be applicable here) but would prefer to do in a separate PR since it would be potentially API breaking