-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
STYLE: Specify bare exceptions in pandas/tests #23370
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 17 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
cd65d8e
Fix issue #22872 - Capture specific exceptions
alexander-ponomaroff 066cdcf
Some fixes
alexander-ponomaroff 318dd54
Further fixes
alexander-ponomaroff 677b707
Test if the problem is in common.py line 217
alexander-ponomaroff fa0b03b
Issue confirmed line 217 of common.py, testing exceptions
alexander-ponomaroff 2f57297
Working through exceptions
alexander-ponomaroff 6cca7d7
Working through exceptions
alexander-ponomaroff 6967323
Fix final bare excepts and stop ignoring E722
alexander-ponomaroff 91c8af2
Added assertion error to line 217 of common.py
alexander-ponomaroff 3fc4499
Line 217 still problematic
alexander-ponomaroff 12b8c34
Rebase
alexander-ponomaroff f055a09
Update pymysql errors
alexander-ponomaroff 4f08510
Merge branch 'master' into issue-22872
alexander-ponomaroff 85e1c9c
Rebase
alexander-ponomaroff 74ce78c
Merge conflict fix
alexander-ponomaroff 39944b6
isort Run on pandas, test_sql.py removed from setup.cfg exclusion list
alexander-ponomaroff c276bd3
merge
alexander-ponomaroff 48ad6f0
Reverted isort changes
alexander-ponomaroff c55692f
import pymysql in the beginning of function
alexander-ponomaroff ff36b21
Remove empty line 1819
alexander-ponomaroff bd3e656
Merge branch 'master' into PR_TOOL_MERGE_PR_23370
jreback 6a86779
Merge branch 'master' into PR_TOOL_MERGE_PR_23370
jreback 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
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 |
---|---|---|
|
@@ -1378,7 +1378,7 @@ def f(): | |
|
||
try: | ||
df = f() | ||
except: | ||
except ValueError: | ||
pass | ||
assert (df['foo', 'one'] == 0).all() | ||
|
||
|
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.
Not very important, but I don't understand this change. The standard is to import Python stdlib first, third-party packages (like hypothesis) later, and the project code (pandas) last.
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.
isort did that, I ran it on the whole repository
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.
So whenever somebody else runs it and since pandas/conftest.py is not in setup.cfg, they should get this change also with isort. Unless something went wrong.
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.
That's weird. Not so important as I said, but if you have time, I'd remove this file from the PR, as nothing really changed here more than the isort changes, which are unrelated. Or if you want to keep, may be we should remove this file from the excludes of isort (assuming it's there).
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.
@alimcmaster1 can you take a look here? May be I'm missing something?
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.
Looks like the CI agrees with me:
It's probably a bug in
isort
when sorting the files, validation seems right.Can you fix, so the CI is green and we can merge?
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.
Thanks @datapythonista will take a look at what is going on with isort and that file this evening.
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 reverted everything that isort did and added test_sql.py back to setup.cfg. I tried running isort a few times, but it just sorts everything the way it sorted the first time.
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.
Running
isort conftest.py
ran OK for me on master. It should already be sorted fine as its not in the setup.cfg. What version of isort are you using? Im running 4.3.4There 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.
@alimcmaster1 My version is 4.3.4 as well.