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

CI: Linting errors from flake >= 3.8.1 #34150

Closed
4 of 5 tasks
mgmarino opened this issue May 13, 2020 · 8 comments · Fixed by #36722
Closed
4 of 5 tasks

CI: Linting errors from flake >= 3.8.1 #34150

mgmarino opened this issue May 13, 2020 · 8 comments · Fixed by #36722
Labels
CI Continuous Integration Code Style Code style, linting, code_checks good first issue
Milestone

Comments

@mgmarino
Copy link
Contributor

mgmarino commented May 13, 2020

The new version of flake bumps the version of pycodestyle, which results in several linting errors on CI. These include:

  • (many instances) E741:ambiguous variable name 'l'
  • (many instances) F541:f-string is missing placeholders
  • (one or few instances) E721:do not compare types, use 'isinstance()'

Here the output:

2020-05-13T05:37:20.8820311Z ##[error]./pandas/_testing.py:630:22:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8824860Z ##[error]./pandas/_testing.py:1006:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8825837Z ##[error]./pandas/core/indexing.py:1569:42:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8826437Z ##[error]./pandas/core/series.py:2588:17:F541:f-string is missing placeholders
2020-05-13T05:37:20.8826992Z ##[error]./pandas/core/common.py:40:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8827546Z ##[error]./pandas/core/common.py:280:20:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8828505Z ##[error]./pandas/core/common.py:288:24:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8829122Z ##[error]./pandas/core/frame.py:685:37:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8830045Z ##[error]./pandas/core/indexes/multi.py:992:49:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8830652Z ##[error]./pandas/core/indexes/multi.py:1143:15:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8831243Z ##[error]./pandas/core/indexes/multi.py:1146:29:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8831817Z ##[error]./pandas/core/reshape/reshape.py:143:37:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8832381Z ##[error]./pandas/core/dtypes/concat.py:27:21:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8832963Z ##[error]./pandas/core/internals/concat.py:446:28:E721:do not compare types, use 'isinstance()'
2020-05-13T05:37:20.8833301Z ##[error]./pandas/core/arrays/interval.py:1054:5:E301:expected 1 blank line, found 0
2020-05-13T05:37:20.8833868Z ##[error]./pandas/util/_doctools.py:37:52:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8834428Z ##[error]./pandas/util/_doctools.py:38:48:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8834986Z ##[error]./pandas/util/_doctools.py:40:49:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8835554Z ##[error]./pandas/util/_doctools.py:41:49:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8836113Z ##[error]./pandas/util/_doctools.py:61:35:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8837945Z ##[error]./pandas/util/_doctools.py:76:55:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8838579Z ##[error]./pandas/util/_doctools.py:77:55:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8839206Z ##[error]./pandas/util/_doctools.py:91:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8839782Z ##[error]./pandas/plotting/_matplotlib/tools.py:374:9:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8840359Z ##[error]./pandas/plotting/_matplotlib/boxplot.py:147:29:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8840933Z ##[error]./pandas/plotting/_matplotlib/boxplot.py:148:43:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8842322Z ##[error]./pandas/plotting/_matplotlib/core.py:1508:56:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8843347Z ##[error]./pandas/io/pytables.py:4587:59:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8844029Z ##[error]./pandas/io/parsers.py:2971:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8845476Z ##[error]./pandas/io/parsers.py:3000:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8846243Z ##[error]./pandas/io/parsers.py:3020:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8847558Z ##[error]./pandas/io/formats/format.py:979:57:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8848615Z ##[error]./pandas/tests/groupby/test_categorical.py:505:13:F541:f-string is missing placeholders
2020-05-13T05:37:20.8849732Z ##[error]./pandas/tests/groupby/transform/test_numba.py:20:46:F541:f-string is missing placeholders
2020-05-13T05:37:20.8850374Z ##[error]./pandas/tests/groupby/transform/test_numba.py:23:46:F541:f-string is missing placeholders
2020-05-13T05:37:20.8851580Z ##[error]./pandas/tests/groupby/aggregate/test_numba.py:21:46:F541:f-string is missing placeholders
2020-05-13T05:37:20.8852714Z ##[error]./pandas/tests/groupby/aggregate/test_numba.py:24:46:F541:f-string is missing placeholders
2020-05-13T05:37:20.8853337Z ##[error]./pandas/tests/indexes/interval/test_interval.py:56:43:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8853951Z ##[error]./pandas/tests/indexes/interval/test_interval.py:77:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8854548Z ##[error]./pandas/tests/indexes/interval/test_constructors.py:333:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8855131Z ##[error]./pandas/tests/indexes/multi/test_indexing.py:797:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8855712Z ##[error]./pandas/tests/plotting/test_datetimelike.py:760:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8856293Z ##[error]./pandas/tests/plotting/test_datetimelike.py:787:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8856877Z ##[error]./pandas/tests/plotting/test_datetimelike.py:800:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8857459Z ##[error]./pandas/tests/plotting/test_datetimelike.py:866:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8858037Z ##[error]./pandas/tests/plotting/test_datetimelike.py:884:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8858611Z ##[error]./pandas/tests/plotting/test_datetimelike.py:997:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8859187Z ##[error]./pandas/tests/plotting/test_datetimelike.py:1006:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8859765Z ##[error]./pandas/tests/plotting/test_datetimelike.py:1131:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8860363Z ##[error]./pandas/tests/plotting/test_datetimelike.py:1135:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8860937Z ##[error]./pandas/tests/plotting/test_datetimelike.py:1236:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8861515Z ##[error]./pandas/tests/frame/methods/test_to_dict.py:121:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8862087Z ##[error]./pandas/tests/reshape/test_pivot.py:2069:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8862677Z ##[error]./pandas/tests/reshape/merge/test_merge.py:2183:38:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8863272Z ##[error]./pandas/tests/reshape/merge/test_merge.py:2183:69:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8863847Z ##[error]./pandas/tests/io/test_stata.py:1864:35:F541:f-string is missing placeholders
2020-05-13T05:37:20.8864409Z ##[error]./pandas/tests/io/test_sql.py:2402:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8864972Z ##[error]./pandas/tests/io/test_sql.py:2683:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8865545Z ##[error]./pandas/tests/io/formats/test_format.py:1801:31:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8866121Z ##[error]./pandas/tests/extension/test_interval.py:30:32:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8866713Z ##[error]./pandas/tests/indexing/test_floats.py:287:50:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8867287Z ##[error]./pandas/tests/indexing/test_floats.py:346:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8867867Z ##[error]./pandas/tests/indexing/test_floats.py:360:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8868581Z ##[error]./pandas/tests/indexing/test_floats.py:383:17:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8869229Z ##[error]./pandas/tests/indexing/test_floats.py:407:48:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8869822Z ##[error]./pandas/tests/indexing/test_floats.py:439:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8870388Z ##[error]./pandas/tests/indexing/test_floats.py:455:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8870956Z ##[error]./pandas/tests/indexing/test_floats.py:470:13:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8871524Z ##[error]./pandas/tests/indexing/test_floats.py:492:66:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8872091Z ##[error]./pandas/tests/indexing/test_floats.py:519:32:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8872862Z ##[error]./pandas/tests/indexing/test_loc.py:802:22:E741:ambiguous variable name 'l'
2020-05-13T05:37:20.8873460Z ##[error]./asv_bench/benchmarks/reshape.py:106:36:E741:ambiguous variable name 'l'

There is an additional issue with flake8-rst, e.g. here:

Happy to have a go, but would like suggestions about how to proceed? Suggestion:

Staged approach:

  • Pin flake < 3.8.0 to deal with flake8-rst issue
  • Ignore errors to get build green
  • Address F541
  • Address E721
  • Address E741 (or not?)
@mgmarino mgmarino added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels May 13, 2020
@mgmarino mgmarino changed the title CI: Linting errors from flake > 3.8.1 CI: Linting errors from flake >= 3.8.1 May 13, 2020
@jreback jreback added Code Style Code style, linting, code_checks CI Continuous Integration and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels May 13, 2020
@jreback jreback added this to the 1.1 milestone May 13, 2020
@jreback
Copy link
Contributor

jreback commented May 13, 2020

for now i would simply fix the version of flake <3.8 until we can address things

@TomAugspurger TomAugspurger modified the milestones: 1.1, Contributions Welcome Jul 7, 2020
@aadithpm
Copy link

aadithpm commented Jul 16, 2020

Is this still open and unassigned? Would like to take this if it is. Mostly wanna clarify how you'd want E741 addressed. As far as my limited knowledge goes, E741 is so we don't get '1' and 'l' or 'O' and '0' confused and so on i.e similar looking characters that might be even more ambiguous with certain fonts.

@mgmarino
Copy link
Contributor Author

I think it's still not possible to move past flake 3.8.1 if flake-rst is still being used, see e.g. flake8-docs/flake8-rst#22

@aadithpm
Copy link

Ah, alright, makes sense. Will this be left open until you can push flake8 to >3.8.1? I'd like to take it when it's actually possible to move forward with it.

@mgmarino
Copy link
Contributor Author

From my point of view, I think you could however definitely address E741 independent of the issues with flake-rst. Then maybe we could close this and open a separate issue for that one?

@aadithpm
Copy link

Yep, did feel that addressing E741 was something that had to be done at some point if flake8 is going to be updated.

What would the process be for this though? As far as I can see, all of the E741 errors seem to be naming variables l. If this is a valid naming convention that does not lead to a lack of understanding, is that something we want to change? I would also assume that since it deals with variable names across multiple files, it would be something that'd have to be put to a vote? Sorry if I'm getting a bit ahead here :)

@fangchenli
Copy link
Member

It looks like flake-rst is not under active development anymore.

@skirpichev
Copy link
Contributor

It looks like flake-rst is not under active development anymore.

Indeed. Though I believe, I have solved the flake8-docs/flake8-rst#22 in flake8-docs/flake8-rst#23.

fangchenli pushed a commit to fangchenli/pandas that referenced this issue Nov 22, 2020
fangchenli pushed a commit to fangchenli/pandas that referenced this issue Nov 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration 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