Skip to content

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!


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