-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
STYLE place standard library imports at top of file #49647
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
Noting in the past that some stdlib imports were deferred (i.e. not at the top level) to help import time (not sure if this is still the case) Lines 259 to 266 in e41b6d7
|
Ah thanks! Can probably just respect the blocklist Lines 48 to 50 in bcb8346
EDIT: done |
Hey, I would like to work on this. |
sure go ahead |
Hi, can I take this ? |
looks like @grtcoder is already working on it |
Hi @grtcoder. Do you mind if I will work on this issue as well? |
feel free to go ahead, doesn't look like it's being worked on |
@natmokval I am starting on this one. I will start with the files under pandas/core/ and pandas/io |
Finished all files except pandas/tests/*. I will work on those next. |
Is there anything for this issue that I can work on? |
Sean,
I have just about finished this one. I am working on the last 3 files now.
Sent with [Proton Mail](https://proton.me/) secure email.
…------- Original Message -------
On Thursday, December 1st, 2022 at 5:35 PM, Sean Patrick Malloy ***@***.***> wrote:
Is there anything for this issue that I can work on?
—
Reply to this email directly, [view it on GitHub](#49647 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFBPFCXNOMPQMMMQPV7OSM3WLEY2XANCNFSM6AAAAAAR5Y3AUU).
You are receiving this because you commented.Message ID: ***@***.***>
|
Alright, thanks for letting me know! |
part 2 of 2 pandas-dev#49647\n\nClean up of standard library imports moving them to the top of the file
part 2 of 2 pandas-dev#49647\n\nClean up of standard library imports moving them to the top of the file
pandas-dev#49647\n\nMerge .pre-commit-config.yaml with current version.
pandas-dev#49647\n\nMerge pandas/tests/series/test_arithetic.py with current version.
Uh oh!
There was an error while loading. Please reload this page.
Imports should typically be placed at the top of files. Sometimes, imports are placed inside functions to:
ImportError
if it's an optional dependencyStandard library imports should really always be at the top of files.
Noticed in #49645 that this is often not the case
I've made a script to automate detecting when this is the case. So the task is:
Then, fixup any errors that are reported. Finally, stage your changes, commit them, push them to your fork, and open a pull request
Feel free to reach out if you into any issues along the way
If any wants to take this, it would be a nice and welcome clean up!
EDIT: after going through a PR, I'm not sure it's worth introducing a check for this - but we can still take some of the cleanups it found
The text was updated successfully, but these errors were encountered: