Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

BertrandDechoux
Copy link
Contributor

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).

@mengxr
Copy link
Contributor

mengxr commented Aug 13, 2015

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"
Copy link
Contributor

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.

@BertrandDechoux
Copy link
Contributor Author

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?
https://amplab.cs.berkeley.edu/jenkins/

@mengxr I will take into account your 2 points. They are indeed both relevant.

@mengxr
Copy link
Contributor

mengxr commented Aug 14, 2015

That is a Jenkins/GitHub sync issue. Let's retest it.

@mengxr
Copy link
Contributor

mengxr commented Aug 14, 2015

test this please

@SparkQA
Copy link

SparkQA commented Aug 14, 2015

Test build #40846 has finished for PR 8062 at commit f2fc5fd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@BertrandDechoux
Copy link
Contributor Author

@mengxr Ok.Thanks.

Let's not apply this directly. Like I said, I will take into account your 2 points.

@SparkQA
Copy link

SparkQA commented Aug 14, 2015

Test build #40862 has finished for PR 8062 at commit 28020bb.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@BertrandDechoux
Copy link
Contributor Author

It's all good.

@BertrandDechoux
Copy link
Contributor Author

@mengxr The pull request can be merged.

@srowen
Copy link
Member

srowen commented Sep 14, 2015

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

@asfgit asfgit closed this in d815654 Sep 14, 2015
@BertrandDechoux
Copy link
Contributor Author

Thanks, I need to clean up my copy of spark. Having no open pull request will help.

@BertrandDechoux BertrandDechoux deleted the SPARK-9720 branch September 14, 2015 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants