-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: Remove bytes input for read_excel #53830
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
Merged
mroeschke
merged 6 commits into
pandas-dev:main
from
rmhowe425:dev/depr/literal-bytes-excel
Jun 27, 2023
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a171b99
Adding deprecation logic and updating documentation.
rmhowe425 17353ea
Adding PR number to new unit test
rmhowe425 5c5bdec
Updating read_excel() documentation per reviewer recommendations.
rmhowe425 17ff094
Updating read_excel() documentation per reviewer recommendations.
rmhowe425 a9ef371
Updating read_excel() documentation per reviewer recommendations.
rmhowe425 c92a3d6
Updating implementation per reviewer recommendations.
rmhowe425 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
To maintain the current behavior during the deprecation, I think we need to continue wrapping this in
BytesIO
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.
Ah yep! I added this back. Thanks for catching this!
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.
It seems that
test_excel_read_binary
still passes without this line on main. If we are wanting to remove this functionality so that we raise when bytes are passed, I think more needs to be done. But I think this can wait until the deprecation is enforced.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.
@rhshadrach I'm a bit confused on your above message 🤔
The test is passing without the line on main because the input to
read_excel
is already a BytesIO object. If I left the input as raw binary the test would fail.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.
The test in question is
data
here is a bytes, not a BytesIO, object. This is passed directly to read_excel.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.
@rhshadrach
@mroeschke has been helping me with a similar problem on a few other PRs.
Are you okay with it if I go ahead and take care of this discrepancy before we submit this one?
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'm pretty sure the fix for this problem is just adding more input validation by using a handful of methods from common.py
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.
Agreed, I think we're okay to deprecate with this PR as is, this can wait until the deprecation is enforced (i.e. the feature of reading bytes is removed in pandas 3.0).