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

CLN: C408 Unnecessary dict call - rewrite as a literal #38138 #38383

Merged
merged 4 commits into from
Dec 9, 2020

Conversation

UrielMaD
Copy link
Contributor

@UrielMaD UrielMaD commented Dec 9, 2020

Fix in:
./pandas/tests/io/generate_legacy_storage_files.py

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @UrielMaD , looks good to me pending green

@UrielMaD
Copy link
Contributor Author

UrielMaD commented Dec 9, 2020

@MarcoGorelli It will be all green in a bit, then maybe it can close the issue, I tried to commit the setup.cfg but then the checks crashes because it has some flake8 errors.

@MarcoGorelli
Copy link
Member

I haven't checked yet, but if there are still some leftover files then we'll need to wait for those to be rewritten before we can update setup.cfg and close the issue

@UrielMaD
Copy link
Contributor Author

UrielMaD commented Dec 9, 2020

I think these were the last 10 files remaining

@MarcoGorelli
Copy link
Member

then I'm not sure why flake8 would fail, can you post the errors?

@UrielMaD
Copy link
Contributor Author

UrielMaD commented Dec 9, 2020

Sure, take a look:

(base) root@7be73fd07673:/workspaces/pandas-urielmd# flake8 setup.cfg
setup.cfg:12:28: E226 missing whitespace around arithmetic operator
setup.cfg:13:27: E226 missing whitespace around arithmetic operator
setup.cfg:15:26: E999 SyntaxError: invalid syntax
setup.cfg:18:4: E226 missing whitespace around arithmetic operator
setup.cfg:18:9: E226 missing whitespace around arithmetic operator
setup.cfg:20:5: E113 unexpected indentation
setup.cfg:28:5: E113 unexpected indentation
setup.cfg:28:8: E226 missing whitespace around arithmetic operator
setup.cfg:28:18: E226 missing whitespace around arithmetic operator
setup.cfg:29:8: E226 missing whitespace around arithmetic operator
setup.cfg:29:14: E226 missing whitespace around arithmetic operator
setup.cfg:30:8: E226 missing whitespace around arithmetic operator
setup.cfg:30:13: E226 missing whitespace around arithmetic operator
setup.cfg:31:10: E226 missing whitespace around arithmetic operator
setup.cfg:35:8: E226 missing whitespace around arithmetic operator
setup.cfg:36:4: E226 missing whitespace around arithmetic operator
setup.cfg:36:9: E226 missing whitespace around arithmetic operator
setup.cfg:38:5: E113 unexpected indentation
setup.cfg:43:10: E111 indentation is not a multiple of four
setup.cfg:43:10: E113 unexpected indentation
setup.cfg:44:10: E111 indentation is not a multiple of four
setup.cfg:45:10: E114 indentation is not a multiple of four (comment)
setup.cfg:46:10: E111 indentation is not a multiple of four
setup.cfg:47:10: E111 indentation is not a multiple of four
setup.cfg:48:10: E114 indentation is not a multiple of four (comment)
setup.cfg:49:10: E111 indentation is not a multiple of four
setup.cfg:50:10: E111 indentation is not a multiple of four
setup.cfg:53:5: E113 unexpected indentation
setup.cfg:53:8: E226 missing whitespace around arithmetic operator
setup.cfg:53:15: E226 missing whitespace around arithmetic operator
setup.cfg:53:27: E226 missing whitespace around arithmetic operator
setup.cfg:60:19: E226 missing whitespace around arithmetic operator
setup.cfg:60:24: E226 missing whitespace around arithmetic operator
setup.cfg:63:5: E113 unexpected indentation
setup.cfg:63:10: E231 missing whitespace after ':'
setup.cfg:63:17: E231 missing whitespace after ':'
setup.cfg:64:10: E231 missing whitespace after ':'
setup.cfg:64:26: E231 missing whitespace after ':'
setup.cfg:65:13: E225 missing whitespace around operator
setup.cfg:70:6: E111 indentation is not a multiple of four
setup.cfg:70:6: E113 unexpected indentation
setup.cfg:70:7: E226 missing whitespace around arithmetic operator
setup.cfg:70:13: E226 missing whitespace around arithmetic operator
setup.cfg:71:6: E111 indentation is not a multiple of four
setup.cfg:71:12: E226 missing whitespace around arithmetic operator
setup.cfg:72:6: E111 indentation is not a multiple of four
setup.cfg:72:12: E226 missing whitespace around arithmetic operator
setup.cfg:79:5: E113 unexpected indentation
setup.cfg:79:11: E226 missing whitespace around arithmetic operator
setup.cfg:82:5: E116 unexpected indentation (comment)
setup.cfg:83:5: E113 unexpected indentation
setup.cfg:96:5: E112 expected an indented block
setup.cfg:97:5: E112 expected an indented block
setup.cfg:99:1: E112 expected an indented block
setup.cfg:105:30: E231 missing whitespace after ','
setup.cfg:105:45: E231 missing whitespace after ','
setup.cfg:105:59: E226 missing whitespace around arithmetic operator
setup.cfg:105:60: E231 missing whitespace after ','
setup.cfg:105:74: E231 missing whitespace after ','
setup.cfg:107:33: E231 missing whitespace after ','
setup.cfg:107:43: E231 missing whitespace after ','
setup.cfg:108:18: E231 missing whitespace after ','
setup.cfg:108:25: E231 missing whitespace after ','
setup.cfg:108:36: E231 missing whitespace after ','
setup.cfg:108:45: E231 missing whitespace after ','
setup.cfg:108:54: E231 missing whitespace after ','
setup.cfg:108:61: E231 missing whitespace after ','
setup.cfg:108:72: E231 missing whitespace after ','
setup.cfg:108:82: E231 missing whitespace after ','
setup.cfg:108:89: E501 line too long (93 > 88 characters)
setup.cfg:114:14: E226 missing whitespace around arithmetic operator
setup.cfg:117:17: E226 missing whitespace around arithmetic operator
setup.cfg:126:6: E226 missing whitespace around arithmetic operator
setup.cfg:127:19: E225 missing whitespace around operator
setup.cfg:129:6: E226 missing whitespace around arithmetic operator
setup.cfg:130:19: E225 missing whitespace around operator
setup.cfg:132:6: E226 missing whitespace around arithmetic operator
setup.cfg:133:19: E225 missing whitespace around operator

@MarcoGorelli
Copy link
Member

you don't need to run flake8 on setup.cfg, but on the rest of the project.

Can you run

pre-commit run flake8 --all-files

? If that passes, we're good to update it and close the issue

@UrielMaD
Copy link
Contributor Author

UrielMaD commented Dec 9, 2020

My bad, there are still some unnecessary dict and tuple calls, I will check all of them and submit a new PR

@MarcoGorelli MarcoGorelli added the Code Style Code style, linting, code_checks label Dec 9, 2020
@MarcoGorelli MarcoGorelli added this to the 1.3 milestone Dec 9, 2020
@MarcoGorelli MarcoGorelli merged commit b3ed7f9 into pandas-dev:master Dec 9, 2020
@MarcoGorelli
Copy link
Member

cool, thanks @UrielMaD !

@MarcoGorelli
Copy link
Member

@UrielMaD looks like there's only pandas/tests/io/parser/test_common.py - if you make a PR for that one and update setup.cfg we should be good to close the issue

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CLN: C408 Unnecessary dict call - rewrite as a literal
2 participants