-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
STYLE enable pylint's redefined-outer-name #49656
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
Comments
Hey, I would like to work on this |
go ahead - as mentioned in the issue:
|
I'll take |
I'll take
|
Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py
Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py
I'll take |
I'll take
|
I'll take:
|
Added a pull request fixing the following files
|
Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py
Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py
Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py
Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py Iteration :- 2
* STYLE: fix pylint redefined-outer-name warnings (#49656) Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py * STYLE: fix pylint redefined-outer-name warnings (#49656) Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py Iteration :- 2
I will take
|
I'll take:
|
Hi, I'd like to work on:
|
Are there any files which haven't been taken so I can work on them? |
Yeah there's still some, I've updated the issue with an up-to-date list Note that https://github.com/pandas-dev/pandas/pull/49668/files is already tackling some, but the rest should be up for grabs Thanks all for your help with this one 🙏 |
Thanks, I'd like to take :
|
I will take: |
Can I also contribute to |
Yes you can i'll leave that file |
Thank you so much! |
We're almost done, there's just:
left If anyone wants to take them, and then (in the same PR) remove these lines from pandas/.pre-commit-config.yaml Lines 81 to 83 in 0429b64
, then we can close the issue |
I will make changes to pandas/core/generic.py and pandas/.pre-commit-config.yaml. |
@Thextan I think we need to fix both format.py and generic.py before we can remove the lines from .pre-commit-config.yaml |
@angularOcean when I ran my check it looked like someone had already fixed io/formats/format.py. I could be mistaken about that. And my changes are not passing the checks, so I may not even be ready for this simple beginner task. Also, I didn't think the changes to .pre-commit-config.yaml was related to the refactoring for redefine-outer-name. |
I'll take a look tomorrow, but if you search for the pandas contributing guide you'll find instructions for how to run the precommit checks |
Please feel free to pick up the changes to core/generic.py, io/formats/format.py (if it still needs work), and .pre-commit-config.yaml. I am reading through the contributing guide to make sure I am doing things correctly. |
…andas-dev#49662) * STYLE: fix pylint redefined-outer-name warnings (pandas-dev#49656) Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py * STYLE: fix pylint redefined-outer-name warnings (pandas-dev#49656) Fixed warnings for the following files :- - pandas/core/arrays/datetimelike.py - pandas/core/base.py - pandas/core/computation/pytables.py Iteration :- 2
…pandas-dev#49708) * t1 * update * update * Update generic.py * update * Update generic.py * Update generic.py * Update generic.py * Update generic.py * Update generic.py * Update generic.py * Update generic.py
…andas-dev#49743) pandas/core/algorithms.py
* Fix concat.py * pandas-dev#49656: update concat.py, fix merge.py * pandas-dev#49656: update concat.py and merge.py
@Thextan not sure what you mean, sorry - your PR has been reviewed, do you plan to address the review? If not, no worries, that's fine, but please close the PR so others can work on it |
If there are still changes to be made to pandas/io/formats/format.py or pandas/core/generic.py, I'm happy to take these on |
Yup, they're still open, if you wanted to submit a PR that'd be great, feel free to reach out (here or on the slack) if anything trips you up |
i'll take |
Have anyone taken pandas/io/formats/format.py yet? If not, can I take it? |
…49937) * changed decimal module import, Decimal function call in EngFormatter class __call__ function * changed name of parameter for get_format_datetime64 to avoid redefined outer name conflict with is_dates_only function * change in argument name for call to get_format_datetime64 to match change in datetimes.py * removed import - justify function not used and creating redefined outer name conflict with justify functions defined for TextAdjustment and EastAsianTextAdjustment classes * replaced justify import with alias to avoid redefined-outer-name conflict * renamed imports from printing module * function renamed to is_dates_only_, returned argument for get_formate_datetime64 to is_dates_only * changes in datetimes.py to reflect function and argument names in format.py * argument and function names swapped * function name is is_dates_only, argument for get_format_datetime64 is is_dates_only_ * Update .pre-commit-config.yaml removed format and datetimes files
only |
I can take it if no one is working on it |
go ahead thanks |
Looks like we forgot to remove this line pandas/.pre-commit-config.yaml Line 97 in a955989
anyone feel like opening a PR to remove it? |
Done |
This warning could potentially prevent bugs, so I'm pretty keen on putting in the effort to enable it.
Many people can work on this one together. To work on it, please:
pylint
version 2.15.5 installed (pip install pylint==2.15.5
) - check this is the same as the number in the.pre-commit-config.yaml
filepylint --disable=all --enable=redefined-outer-name <file>
For example, suppose you choose the file
pandas/io/json/_table_schema.py
. Runningpylint
on it, you get:If we look at that file, we see that there's a function
which takes
json
as an argument, but the file also hasat the top.
The simplest fix is probably to just modify the import to be
and then to remove
pandas/pandas/io/json/_table_schema.py
Line 44 in f9ff379
as
loads
is the only function used frompandas._libs.json
.Other notes:
It's probably worth running
pylint
on a directory first to see what files need working on, e.g.Files that still need fixing:
Let's ignore test files for now
The text was updated successfully, but these errors were encountered: