Skip to content

Fix joblib is imported with both import and import from #14150

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

Closed
wants to merge 1 commit into from

Conversation

Kibugu
Copy link

@Kibugu Kibugu commented Jun 22, 2019

Reference Issues/PRs

#12167

Fixes Module 'joblib' is imported with both 'import' and 'import from' in
Source root/sklearn/datasets/lfw.py

What does this implement/fix? Explain your changes.

Deleted line 19 (from joblib import Memory)
updated all instance of Memory to joblib.Memory

Any other comments?

#WiMDS

@adrinjalali
Copy link
Member

I didn't know this is not "okay" to do. I'm agnostic about it I guess. But also don't mind reducing LGTM warnings.

@adrinjalali
Copy link
Member

I would leave this open for another member to comment at least :)

@adrinjalali adrinjalali reopened this Jun 22, 2019
@thomasjpfan
Copy link
Member

I’m surprised this is a LGTM warning. I am +0 on this change.

@jnothman
Copy link
Member

I’m surprised this is a LGTM warning. I am +0 on this change.

Yeah, me too. I wonder what it's trying to avoid.

@qinhanmin2014
Copy link
Member

From LGTM https://lgtm.com/rules/1818040193/
Importing a module twice using the import xxx and from xxx import yyy is confusing.

@qinhanmin2014
Copy link
Member

also +0

@rth
Copy link
Member

rth commented Jun 23, 2019

IMO that LGTM.org warning is a bit controversial. Just because one does

import sklearn

somewhere (for instance, to check version), it would require people to use the full import paths everywhere e.g. sklearn.linear_model.LogisticRegression. I don't think that it's realistic and that we should enforce it.

Closing as it doesn't look like we are going get a +2 vote on this one. Sorry, @Kibugu and thanks for contributing. There are likely other warnings in need of fixing :)

@rth rth closed this Jun 23, 2019
@jnothman
Copy link
Member

Maybe @Kibugu would like to investigate if there's a way to configure our use of lgtm.com to disregard this kind of alert.

@thomasjpfan
Copy link
Member

Hint: https://lgtm.com/help/lgtm/lgtm.yml-configuration-file in section "queries"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants