-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[MINOR][MLlib][SQL] Clean up unused variables and unused import #14836
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
Conversation
|
|
||
| /** | ||
| * Create an [[org.apache.spark.Accumulator]] variable of a given type, which tasks can "add" | ||
| * Create an [[org.apache.spark.Accumulator]] variable of a given type, to which tasks can "add" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't grammatical now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh right...reverting it...
|
|
||
| val d = sc.parallelize(1 to 20) | ||
| an [Exception] should be thrownBy {d.foreach{x => acc.value = x}} | ||
| an [SparkException] should be thrownBy {d.foreach{x => acc.value = x}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this to
intercept[SparkException] {
d.foreach(x => acc.value = x)
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, doing it now
|
Test build #64501 has finished for PR 14836 at commit
|
|
I just noticed that there are many other places where 'PropSpec' style is used |
|
Test build #64506 has finished for PR 14836 at commit
|
|
Test build #64504 has finished for PR 14836 at commit
|
|
Jenkins retest this please |
|
Test build #64513 has finished for PR 14836 at commit
|
|
Test build #64522 has finished for PR 14836 at commit
|
| withSQLConf("spark.sql.autoBroadcastJoinThreshold" -> "2") { | ||
| val df = spark.range(100).toDF() | ||
| val join = df.join(df, "id") | ||
| val plan = join.queryExecution.executedPlan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is without side effects, even though clearly the variable isn't used. I don't think you can remove the line, necessarily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I look carefully about it and you are right. I'll undo it.
|
I think the other changes are trivial but not wrong. I'd generally not bother with these bitty changes. It's not that they're wrong but that it takes me some time to go think through whether they're valid, and it's probably not worth our time collectively. |
|
Thanks Sean, I got what you mean. I'll avoid such PRs in the future, thanks a lot for the tips. |
|
Test build #64584 has finished for PR 14836 at commit
|
|
Merged to master |
What changes were proposed in this pull request?
Clean up unused variables and unused import statements, unnecessary
returnandtoArray, and some more style improvement, when I walk through the code examples.How was this patch tested?
Testet manually on local laptop.