Uh oh!
There was an error while loading. Please reload this page.
[SPARK-26754][PYTHON] Add hasTrainingSummary to replace duplicate code in PySpark - #23676
[SPARK-26754][PYTHON] Add hasTrainingSummary to replace duplicate code in PySpark#23676huaxingao wants to merge 2 commits into
Conversation
SparkQA
commented
Jan 28, 2019
Test build #101774 has finished for PR 23676 at commit
|
| """ | ||
| @property | ||
| @since("3.0.0") |
There was a problem hiding this comment.
The only issue I see here is that these properties were effectively added to subclasses in 2.0.0 and 2.1.0, so this seems somewhat misleading. Maybe we can declare these "since 2.1.0" as close enough?
| Gets summary of the model trained on the training set. An exception is thrown if | ||
| no summary exists. | ||
| """ | ||
| if self.hasSummary: |
There was a problem hiding this comment.
You could also call "summary" directly though I suppose that would result in a different, possibly less useful error. I was also wondering whether RuntimeError is the right one, but I see other call sites above throw this when there is no summary.
Can you remove other checks for "if self.hasSummary" then, above? because when summary() is called it will now throw this error already.
SparkQA
commented
Jan 30, 2019
Test build #101911 has finished for PR 23676 at commit
|
| @@ -532,24 +533,16 @@ def summary(self): | |||
| trained on the training set. An exception is thrown if `trainingSummary is None`. | |||
| """ | |||
| if self.hasSummary: | |||
There was a problem hiding this comment.
Pardon if you were already going to follow up on this, but I think you don't need to check self.hasSummary here and other classes anymore. The implementation in the new trait can do that in one place.
Uh oh!
There was an error while loading. Please reload this page.
srowen
commented
Feb 1, 2019
OK I get it, yeah, the polymorphism doesn't come across, and has to be mirrored in Python. |
srowen
commented
Feb 1, 2019
Merged to master |
huaxingao
commented
Feb 1, 2019
Thanks a lot for your help! @srowen |
…e in PySpark ## What changes were proposed in this pull request? Python version of apache#17654 ## How was this patch tested? Existing Python unit test Closesapache#23676 from huaxingao/spark26754. Authored-by: Huaxin Gao <huaxing@us.ibm.com> Signed-off-by: Sean Owen <sean.owen@databricks.com>
What changes were proposed in this pull request?
Python version of #17654
How was this patch tested?
Existing Python unit test