Skip to content

STYLE: fix pylint redefined-outer-name warnings #49822

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 5 commits into from
Nov 22, 2022

Conversation

JasmandeepKaur
Copy link
Contributor

Fixed redefined-outer-name linting issue in the following files (Towards #49656)

  • pandas/util/_decorators.py
  • pandas/util/_doctools.py
  • pandas/util/_test_decorators.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 for working on this!

@@ -168,28 +168,28 @@ def _make_table(self, ax, df, title: str, height: float | None = None) -> None:


if __name__ == "__main__":
import matplotlib.pyplot as plt
import matplotlib.pyplot as pyplot
Copy link
Member

Choose a reason for hiding this comment

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

instead of renaming this (as plt is a pretty standard import), how about we put:

def main():
    import matplotlib.pyplot as plt

    p = TablePlotter()
    <put the rest of the file here>

and then, right underneat that:

if __name__ == "__main__":
    main()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it.

@JasmandeepKaur
Copy link
Contributor Author

JasmandeepKaur commented Nov 21, 2022

@MarcoGorelli Addressed the requested changes in _doctools.py. Could you please review and let me know of any required changes? Thanks in advance!

@MarcoGorelli
Copy link
Member

can you run the pre-commit checks? see the contributing guide for how

@JasmandeepKaur
Copy link
Contributor Author

can you run the pre-commit checks? see the contributing guide for how

Will do.

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Nov 21, 2022
@JasmandeepKaur
Copy link
Contributor Author

@MarcoGorelli I ran the pre-commit commands. The utils/_doctools.py had some changes which are now pushed. Let me know if there are any other needed changes.

@MarcoGorelli MarcoGorelli added this to the 2.0 milestone Nov 22, 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 @JasmandeepKaur !

@MarcoGorelli MarcoGorelli merged commit 556848e into pandas-dev:main Nov 22, 2022
@JasmandeepKaur
Copy link
Contributor Author

Glad I could help. Thanks for letting me contribute!

mliu08 pushed a commit to mliu08/pandas that referenced this pull request Nov 27, 2022
* STYLE: fix pylint redefined-outer-name warnings

* removing _test_decorators.py

* Moving into a main function

* pre-commit changes
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.

3 participants