Skip to content

STYLE enable pylint's redefined-outer-name #49671

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

Merged
merged 4 commits into from
Nov 14, 2022

Conversation

alphacrack
Copy link
Contributor

Fixed warnings for the following files :-

  • pandas/core/dtypes/cast.py
  • pandas/core/dtypes/dtypes.py
  • pandas/core/indexes/base.py

Comment on lines 7 to 10
from datetime import (
datetime,
timedelta,
datetime as datetime_func,
timedelta as timedelta_func,
)
Copy link
Member

Choose a reason for hiding this comment

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

would import datetime as dt (and then dt.datetime, dt.timedelta) work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good.

Comment on lines 137 to 141
from pandas.core import (
missing as missing_func,
arraylike,
missing,
ops,
)
Copy link
Member

Choose a reason for hiding this comment

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

missing isn't a function, so missing_func wouldn't be the best name

Copy link
Member

Choose a reason for hiding this comment

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

what was the issue with what you had before (from pandas.core.missing import clean_reindex_fill_method)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The build pipeline failed at https://github.com/pandas-dev/pandas/actions/runs/3452096357/jobs/5761771671 which is failing still with missing_func. from pandas.core.missing import clean_reindex_fill_method worked locally but since pipeline failed , chaged it.

Copy link
Member

Choose a reason for hiding this comment

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

it was fine, you just need to run pre-commit on the files you've changed, check the contributing guide for how to do that

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks did run it.

Copy link
Member

Choose a reason for hiding this comment

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

cool, should be good now thanks

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.

Looks good to me, thanks @alphacrack , though the

import pandas_dtype as pandas_dtype_func

pattern isn't already present in pandas (I think), so leaving open for a bit in case others have objections

@MarcoGorelli MarcoGorelli added the Code Style Code style, linting, code_checks label Nov 13, 2022
@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Nov 13, 2022
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 @alphacrack , if noone has objections I'll merge later

@MarcoGorelli MarcoGorelli merged commit c7010a7 into pandas-dev:main Nov 14, 2022
MarcoGorelli pushed a commit to MarcoGorelli/pandas that referenced this pull request Nov 18, 2022
* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

Co-authored-by: bishwas jha <[email protected]>
mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

* fix warning for pandas/core/dtypes/cast.py, pandas/core/dtypes/dtypes.py, pandas/core/indexes/base.py

Co-authored-by: bishwas jha <[email protected]>
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.

2 participants