-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-9720] [ML] Identifiable types need UID in toString methods #8062
Conversation
ok to test |
@@ -144,7 +144,7 @@ final class DecisionTreeClassificationModel private[ml] ( | |||
} | |||
|
|||
override def toString: String = { | |||
s"DecisionTreeClassificationModel of depth $depth with $numNodes nodes" | |||
s"${super.toString} DecisionTreeClassificationModel of depth $depth with $numNodes nodes" |
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.
How about using $uid
directly in toString
implementation? It is not guaranteed that super.toString
contains the UID. I suggest DecisionTreeClassificationModel (uid=$uid) of depth $depth with $numNodes nodes
.
Like I said, I didn't run the test. There seems to be no clear easy way. I will have to invest time to find out. Is there a way to see the result of amplab jenkins for this pull request? @mengxr I will take into account your 2 points. They are indeed both relevant. |
That is a Jenkins/GitHub sync issue. Let's retest it. |
test this please |
Test build #40846 has finished for PR 8062 at commit
|
@mengxr Ok.Thanks. Let's not apply this directly. Like I said, I will take into account your 2 points. |
Test build #40862 has finished for PR 8062 at commit
|
It's all good. |
@mengxr The pull request can be merged. |
From reading the description of the JIRA, this looks like the intent and looks like it was applied consistently, test pass, etc. LGTM for master |
Thanks, I need to clean up my copy of spark. Having no open pull request will help. |
A few Identifiable types did override their toString method but without using the parent implementation. As a consequence, the uid was not present anymore in the toString result. It is the default behaviour.
This patch is a quick fix. The question of enforcement is still up.
No tests have been written to verify the toString method behaviour. That would be long to do because all types should be tested and not only those which have a regression now.
It is possible to enforce the condition using the compiler by making the toString method final but that would introduce unwanted potential API breaking changes (see jira).