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

STYLE: support flake8>3.4.1 #18419

Closed
jreback opened this issue Nov 22, 2017 · 7 comments
Closed

STYLE: support flake8>3.4.1 #18419

jreback opened this issue Nov 22, 2017 · 7 comments
Labels
Code Style Code style, linting, code_checks good first issue
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Nov 22, 2017

flake8 > 3.4.1 has a fair amount more warnings

we need to either fix our code or remove the warnings

example from: https://travis-ci.org/pandas-dev/pandas/jobs/305553688

note that #18418 will pin 3.4.1, so these won't show in the CI.
We will need to revert this commit once things are fixed.

prob ok to turn off E740 (though fixing is not a big deal)
should fix the E722

$ ci/lint.sh
inside ci/lint.sh
Linting *.py
pandas/compat/pickle_compat.py:36:13: E722 do not use bare except'
pandas/compat/pickle_compat.py:47:13: E722 do not use bare except'
pandas/compat/pickle_compat.py:171:1: E722 do not use bare except'
pandas/compat/pickle_compat.py:199:5: E722 do not use bare except'
pandas/core/categorical.py:601:9: E722 do not use bare except'
pandas/core/common.py:571:5: E722 do not use bare except'
pandas/core/common.py:589:5: E722 do not use bare except'
pandas/core/common.py:608:5: E722 do not use bare except'
pandas/core/common.py:620:5: E722 do not use bare except'
pandas/core/frame.py:2118:9: E722 do not use bare except'
pandas/core/frame.py:2561:13: E722 do not use bare except'
pandas/core/frame.py:5717:21: E722 do not use bare except'
pandas/core/frame.py:6232:9: E722 do not use bare except'
pandas/core/indexing.py:136:13: E722 do not use bare except'
pandas/core/indexing.py:540:17: E741 ambiguous variable name 'l'
pandas/core/indexing.py:698:21: E741 ambiguous variable name 'l'
@jreback jreback added Difficulty Novice Code Style Code style, linting, code_checks labels Nov 22, 2017
@jreback jreback added this to the 0.22.0 milestone Nov 22, 2017
@AaronCritchley
Copy link
Contributor

On the E722 errors, are you happy if they're modified to except Exception? Or preferred to explicitly catch Exceptions we're expecting?

Happy to fix the E741 issues too

@jreback
Copy link
Contributor Author

jreback commented Dec 4, 2017

would really like to be explicit on exceptions and put what is actually thrown rather than Exception

@tzyl
Copy link

tzyl commented May 30, 2018

Hey @jreback, is this still open? When running the ci/lint.sh script locally with [email protected] I see E722 errors only. Happy to take a look at this if you still want this to be done.

@WillAyd
Copy link
Member

WillAyd commented May 30, 2018

@tzyl still open - PRs are welcome

AaronCritchley added a commit to AaronCritchley/pandas that referenced this issue Aug 27, 2018
@AaronCritchley
Copy link
Contributor

Working on this now, will hopefully have done by tomorrow but there are lots of E722 issues. I'm making some (not so) educated guesses on expected exceptions, but where I can't derive the original intent / logic I'm just changing to except Exception, happy for these cases to be changed when it comes to reviewing the PR if someone else can make an informed guess.

Sorry for going quiet on this back in Dec, not sure what happened, my bad!

@AaronCritchley
Copy link
Contributor

Open for anyone else to pick this up or to do so in smaller chunks - @jreback provided some insights on how to approach here:

#22625 (comment)

@datapythonista
Copy link
Member

Superseeded by #22872, #22873, #22874, #22875 and #22877

flake8 > 3.4.1 supported since #22863 (E722 added to ignored error codes, while previous issues are not addressed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Style Code style, linting, code_checks good first issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants