[Minor][ML][MLLIB] Remove unused imports#12497
[Minor][ML][MLLIB] Remove unused imports#12497zhengruifeng wants to merge 13 commits intoapache:masterfrom
Conversation
|
Hm, is this the kind of thing we want to do in pretty big sweeps or not at all? There are tens of files that could have their imports trimmed. |
|
@srowen It seems most scala files dont have unused imports. If it's unnecessary, I will close this PR. |
|
cc @yanboliang |
|
Test build #56226 has finished for PR 12497 at commit
|
|
Test build #56232 has finished for PR 12497 at commit
|
|
Test build #56233 has finished for PR 12497 at commit
|
|
Yea - I think we either try to do this at scale or not do it at all. Thanks for the contribution. |
|
I have manually reviewed all scala imports in ML/MLLib twice. IMO that is all. |
|
Test build #56294 has finished for PR 12497 at commit
|
|
Test build #56295 has finished for PR 12497 at commit
|
|
Since this is something that would be good to do globally, if at all, and there are automated tools to find this type of problem, I'd run an IDE over this to find and fix them in one go. For example, I pushed a button in IDEA and found more unused imports in: ExternalShuffleBlockHandlerSuite.java Although it also easily flags unused imports in Scala in the editor, I couldn't find an inspection for it. It does let you automatically optimize imports in Scala, though by default it will reorder them and other things, which can be disabled. It still seems like a hard way to just discover unused imports without changing a lot of stuff. For now if we can get as many fixed in one go as is reasonably possible, maybe that's sufficient. |
|
@srowen IDEA's unused hint may be wrong in some place. |
|
Agree, of course we have to test the result of removing "unused" imports in any event, and that's less obvious for Scala. It gets it right most of the time. In any event, the Java inspections are reliable. |
|
@zhengruifeng this one needs a rebase, and you can remove more unused imports per above while you're at it |
8aff210 to
90e57c8
Compare
|
@srowen I have reviewed all scala files in Graphx and some in SQL. And remove another some unused imports in this PR. |
|
Test build #56778 has finished for PR 12497 at commit
|
|
Thanks - merging in master. |
|
Test build #56777 has finished for PR 12497 at commit
|
What changes were proposed in this pull request?
del unused imports in ML/MLLIB
How was this patch tested?
unit tests