Skip to content

Remove redundant typing import #18004

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 2 commits into from
Jul 27, 2020
Merged

Remove redundant typing import #18004

merged 2 commits into from
Jul 27, 2020

Conversation

mani2106
Copy link
Contributor

Reference Issues/PRs

Progress towards #12167.

What does this implement/fix? Explain your changes.

This removes the LGTM error alert A module is imported with the "import" and "import from" statements

Any other comments?

This removes the LGTM error alert for `A module is imported with the "import" and "import from" statements`
@ogrisel
Copy link
Member

ogrisel commented Jul 27, 2020

This is weird: this import line is longer than 80 chars and the linter does not complain.

@mani2106
Copy link
Contributor Author

Should I change that line to something like this?

from typing import (TYPE_CHECKING, Any, Dict, Iterator, List, Optional, Tuple,
                    Union)

@ogrisel
Copy link
Member

ogrisel commented Jul 27, 2020

I would rather avoid the parens and split on two lines with repeated imports to minimize conflict probabilities:

from typing import TYPE_CHECKING
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union

Modified length of import statement to meet length constraints
Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks! We generally don't modify vendored files (in externals/ folder) and they are typically not linted.

In this case it's fine to modify it, as we had to change these lines when adding typing to openml fetcher in #17053 and we still need to contribute them upstream.

@rth rth merged commit f642ff7 into scikit-learn:master Jul 27, 2020
@mani2106 mani2106 deleted the patch-1 branch July 29, 2020 06:00
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants