Skip to content

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

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

Closed
61 tasks done
fangchenli opened this issue Nov 28, 2020 · 21 comments · Fixed by #38383 or #38385
Closed
61 tasks done

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

fangchenli opened this issue Nov 28, 2020 · 21 comments · Fixed by #38383 or #38385
Labels
Clean Code Style Code style, linting, code_checks good first issue

Comments

@fangchenli
Copy link
Member

fangchenli commented Nov 28, 2020

The following files contain flake8 C408 Unnecessary dict call - rewrite as a literal. Good for first time contributors. See #38078 and #38116 for how to fix them. Use flake8 [file_path] to check for each file.

C408

  • ./pandas/core/generic.py
  • ./pandas/core/series.py
  • ./pandas/core/frame.py
  • ./pandas/core/strings/accessor.py
  • ./pandas/core/dtypes/dtypes.py
  • ./pandas/core/computation/pytables.py
  • ./pandas/core/computation/expressions.py
  • ./pandas/core/arrays/floating.py
  • ./pandas/core/arrays/interval.py
  • ./pandas/core/arrays/numpy_.py
  • ./pandas/core/arrays/base.py
  • ./pandas/core/ops/methods.py
  • ./pandas/core/indexes/interval.py
  • ./pandas/core/indexes/multi.py
  • ./pandas/core/indexes/numeric.py
  • ./pandas/core/indexes/base.py
  • ./pandas/io/pytables.py
  • ./pandas/tests/reshape/concat/test_datetimes.py
  • ./pandas/tests/reshape/merge/test_merge.py
  • ./pandas/tests/reshape/merge/test_multi.py
  • ./pandas/tests/tools/test_to_numeric.py
  • ./pandas/tests/resample/test_time_grouper.py
  • ./pandas/tests/util/test_assert_series_equal.py
  • ./pandas/tests/util/test_assert_interval_array_equal.py
  • ./pandas/tests/util/test_assert_index_equal.py
  • ./pandas/tests/util/test_assert_extension_array_equal.py
  • ./pandas/tests/io/test_parquet.py
  • ./pandas/tests/io/generate_legacy_storage_files.py
  • ./pandas/tests/io/formats/test_format.py
  • ./pandas/tests/io/parser/test_comment.py
  • ./pandas/tests/io/parser/test_parse_dates.py
  • ./pandas/tests/io/parser/test_c_parser_only.py
  • ./pandas/tests/io/parser/test_dialect.py
  • ./pandas/tests/io/parser/test_skiprows.py
  • ./pandas/tests/io/parser/test_encoding.py
  • ./pandas/tests/io/parser/test_read_fwf.py
  • ./pandas/tests/io/parser/test_python_parser_only.py
  • ./pandas/tests/io/parser/test_na_values.py
  • ./pandas/tests/io/parser/test_usecols.py
  • ./pandas/tests/io/parser/test_quoting.py
  • ./pandas/tests/io/parser/test_header.py
  • ./pandas/tests/io/parser/test_index_col.py
  • ./pandas/tests/io/json/test_ujson.py
  • ./pandas/tests/io/json/test_normalize.py
  • ./pandas/tests/io/pytables/test_timezones.py
  • ./pandas/tests/io/pytables/test_store.py
  • ./pandas/tests/frame/test_reductions.py
  • ./pandas/tests/frame/test_arithmetic.py
  • ./pandas/tests/frame/methods/test_to_records.py
  • ./pandas/tests/frame/methods/test_sort_values.py
  • ./pandas/tests/frame/methods/test_fillna.py
  • ./pandas/tests/frame/methods/test_to_csv.py
  • ./pandas/tests/frame/indexing/test_indexing.py
  • ./pandas/tests/frame/indexing/test_where.py
  • ./pandas/tests/dtypes/test_inference.py
  • ./pandas/tests/groupby/test_function.py
  • ./pandas/tests/groupby/transform/test_transform.py
  • ./pandas/tests/plotting/test_boxplot_method.py
  • ./pandas/tests/plotting/frame/test_frame_subplots.py
  • ./pandas/tests/io/parser/test_common.py

Remove ignore setting from flake8 section

  • setup.cfg
@fangchenli fangchenli added Bug Needs Triage Issue that has not been reviewed by a pandas team member Clean good first issue Code Style Code style, linting, code_checks and removed Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Nov 28, 2020
@liudj2008
Copy link
Contributor

liudj2008 commented Nov 30, 2020

I would like to take the followings as the first step

./pandas/core/generic.py
./pandas/core/series.py
./pandas/core/frame.py

@skvrahul
Copy link
Contributor

Created a PR (#38180 )that addresses the following files:

./pandas/tests/reshape/concat/test_datetimes.py
./pandas/tests/reshape/merge/test_merge.py
./pandas/tests/reshape/merge/test_multi.py

@fangchenli Is a whatsnew entry necessary for such a change in the code?

@Qbiwan
Copy link
Contributor

Qbiwan commented Nov 30, 2020

first-time contributor here; please let me know if I'd missed anything

@pillemer
Copy link

pillemer commented Dec 1, 2020

Hi, I'm new to contributing and would like to help on this issue. Do I need to request to work on specific files before I start?

@fangchenli
Copy link
Member Author

Hi, I'm new to contributing and would like to help on this issue. Do I need to request to work on specific files before I start?

No, that is not necessary.

@jreback
Copy link
Contributor

jreback commented Dec 2, 2020

@fangchenli if you have a chance can you check things off from the merged PRs

@austiezr
Copy link

austiezr commented Dec 2, 2020

Just submitted a PR to fix another swath of this.

@gerardjorgensen
Copy link
Contributor

I would like to start working on the following
./pandas/tests/io/json/test_ujson.py
./pandas/tests/io/json/test_normalize.py

@gerardjorgensen gerardjorgensen mentioned this issue Dec 3, 2020
5 tasks
@vmdhhh
Copy link
Contributor

vmdhhh commented Dec 3, 2020

Hi @jreback
First time contributing
I would like to take up ./pandas/tests/io/pytables/test_store.py
I will start working on it, please let me know otherwise

I would also take up and push to the same PR #38263

EDIT: ./pandas/tests/io/pytables/test_store.py
./pandas/core/arrays/interval.py work complete as part of #38263
Please review.

@vmdhhh
Copy link
Contributor

vmdhhh commented Dec 3, 2020

@zanuttin hey, ./pandas/core/arrays/interval.py is already up for merge in #38263.
Just to avoid rework, maybe you could take something else if possible?

@joao-zanutto
Copy link
Contributor

I have already pushed the modifications @vmdhhh, sorry for not paying attention on your first comment.
From what I've checked we did the same modifications, not sure if this is enough to not generate a conflict though.

UrielMaD added a commit to UrielMaD/pandas that referenced this issue Dec 4, 2020
UrielMaD added a commit to UrielMaD/pandas that referenced this issue Dec 4, 2020
@UrielMaD
Copy link
Contributor

UrielMaD commented Dec 4, 2020

Hello @jreback , I just submitted a PR for ./pandas/core/strings/accessor.py and it passed all checks!
if you have a chance could you please check it?

#38138

@UrielMaD
Copy link
Contributor

UrielMaD commented Dec 4, 2020

Hi again @jreback, I checked the file ./pandas/core/dtypes/dtypes.py and it has no unnecessary dict calls

also added 5 more files that passed all checks:

pandas/core/arrays/base.py
pandas/core/computation/pytables.py
pandas/core/indexes/base.py
pandas/core/ops/methods.py
pandas/io/pytables.py

jreback pushed a commit that referenced this issue Dec 4, 2020
fangchenli pushed a commit to fangchenli/pandas that referenced this issue Dec 5, 2020
@fangchenli
Copy link
Member Author

I've checked everything in #38320 (not merged yet) off. Please select from the remaining files to work on.

@shrutiguptabu
Copy link

Hello,

I would like to take

./pandas/tests/io/parser/test_parse_dates.py
./pandas/tests/io/generate_legacy_storage_files.py

as my first issue.

@pillemer
Copy link

pillemer commented Dec 6, 2020

I will do /pandas/tests/io/parser/test_index_col.py

jreback pushed a commit that referenced this issue Dec 7, 2020
Co-authored-by: VirosaLi <2EkF8qUgpNkj>
@UrielMaD
Copy link
Contributor

UrielMaD commented Dec 9, 2020

Hi @jreback I just updated the last 10 files remaining, this will close the issue,
there's just the setup.cfg file to be changed, I tried to do it but it throws some flake8 errors and didn't passed the checks

MarcoGorelli pushed a commit that referenced this issue Dec 9, 2020
* last dict fixings

* last dict fixings

* last dict fixings

* last dict fixings
@jreback jreback reopened this Dec 9, 2020
@jreback
Copy link
Contributor

jreback commented Dec 9, 2020

close the issue when the checks are updated

@MarcoGorelli
Copy link
Member

sorry didn't realise there was the "closes" keyword in the PR, will check more carefully next time

fangchenli pushed a commit to fangchenli/pandas that referenced this issue Dec 9, 2020
@fangchenli fangchenli mentioned this issue Dec 9, 2020
1 task
simonjayhawkins pushed a commit that referenced this issue Dec 9, 2020
Co-authored-by: VirosaLi <2EkF8qUgpNkj>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment