-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN GH22875 Replace bare excepts by explicit excepts in pandas/io/ #23004
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
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6b9ebcf
CLN GH22785 Replace bare excepts by explicit excepts in pandas/io/
JustinZhengBC 53d9fb8
CLN GH22875 Modify previous commit so flake8 passes
JustinZhengBC f53b29f
CLN GH22875 Fix pandas/io/packers.py
JustinZhengBC b4f15c7
CLN GH22875 Fix other except in pandas/io/packers.py
JustinZhengBC 8c17a95
CLN GH22875 Incorporated feedback from tests
JustinZhengBC 90cfe17
CLN GH22875 Delete unnecessary comments and incorporate test feedback
JustinZhengBC b1d381a
CLN GH22875 Add comments where necessry
JustinZhengBC e2e30bd
CLN GH22875 Put back pickle branch and add TODO
JustinZhengBC 9ddfdb5
CLN GH22875 Retry travis build due to HTTP error
JustinZhengBC e6610fa
CLN GH22875 Fix linting problem
JustinZhengBC ee85901
CLN GH22875 See if Travis works now
JustinZhengBC 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,16 +165,11 @@ def try_read(path, encoding=None): | |
return read_wrapper(lambda f: pkl.load(f)) | ||
except Exception: | ||
# reg/patched pickle | ||
try: | ||
return read_wrapper( | ||
lambda f: pc.load(f, encoding=encoding, compat=False)) | ||
# compat pickle | ||
except: | ||
return read_wrapper( | ||
lambda f: pc.load(f, encoding=encoding, compat=True)) | ||
return read_wrapper( | ||
lambda f: pc.load(f, encoding=encoding, compat=False)) | ||
try: | ||
return try_read(path) | ||
except: | ||
except Exception: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a comment here |
||
if PY3: | ||
return try_read(path, encoding='latin1') | ||
raise | ||
|
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
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.
is there a reason you elminated this branch here? IIRC this was a perf issue (IOW try the compat=False), but I wrote this code a long time ago.
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.
Yes, it appears that since then, someone has modified the load function so that compat isn't used at all.
pandas/pandas/compat/pickle_compat.py
Lines 189 to 214 in 5551bcf
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 am skeptical, I put this here because of performance issues. Can you run the asv for the pickle tests? though it might be only a case of reading py2 in py3 which is affected by this, which we prob don't perf check.
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 you also see if we actually hit this branch in any tests (meaning the try part is certainly hit, but the except is the question)