You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by BryanCutler <gi...@git.apache.org> on 2016/04/11 21:00:30 UTC
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
GitHub user BryanCutler opened a pull request:
https://github.com/apache/spark/pull/12304
[SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrapper and related class hierarchy
Currently, JavaWrapper is only a wrapper class for pipeline classes that have Params and JavaCallable is a separate mixin that provides methods to make Java calls. This change simplifies the class structure and to define the Java wrapper in a plain base class along with methods to make Java calls. Also, renames Java wrapper classes to better reflect their purpose.
Ran existing Python ml tests and generated documentation to test this change.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/BryanCutler/spark pyspark-cleanup-JavaWrapper-SPARK-14472
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/12304.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #12304
----
commit b8d022a577d20ac213fb263f973172c23d2f2ee7
Author: Bryan Cutler <cu...@gmail.com>
Date: 2016-04-11T16:12:15Z
[SPARK-14472] Made JavaCallable a base class to JavaWrapper to define _java_obj and creating Java objects
commit c95ba2782c002c531b3d46cb4e770c5ace52215d
Author: Bryan Cutler <cu...@gmail.com>
Date: 2016-04-11T18:33:51Z
Renamed classes to better reflect purpose, JavaWrapper to JavaWrapperParams and JavaCallable to JavaWrapper
commit c1d41c7de25ba798abd4da5b342df15eede442b5
Author: Bryan Cutler <cu...@gmail.com>
Date: 2016-04-11T18:37:23Z
Made alternate constructor for JavaWrapper private so doesn't appear in docs
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-208502064
**[Test build #55532 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55532/consoleFull)** for PR 12304 at commit [`c1d41c7`](https://github.com/apache/spark/commit/c1d41c7de25ba798abd4da5b342df15eede442b5).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by BryanCutler <gi...@git.apache.org>.
Github user BryanCutler commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209133034
I was thinking that the other classes, like `JavaModel`, actually wrap that object so I used a slightly different name - but I agree, `JavaParams` sounds much better and it's an abstract class that will end up wrapping an object with Params, so I think it's fine.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209145914
**[Test build #55661 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55661/consoleFull)** for PR 12304 at commit [`8121a3d`](https://github.com/apache/spark/commit/8121a3dd08d478e7de3fab8d80974beb50592abf).
* This patch **fails MiMa tests**.
* This patch merges cleanly.
* This patch adds the following public classes _(experimental)_:
* `class JavaEvaluator(JavaParams, Evaluator):`
* `class JavaParams(JavaWrapper, Params):`
* `class JavaEstimator(JavaParams, Estimator):`
* `class JavaTransformer(JavaParams, Transformer):`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/12304
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209143266
**[Test build #55661 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55661/consoleFull)** for PR 12304 at commit [`8121a3d`](https://github.com/apache/spark/commit/8121a3dd08d478e7de3fab8d80974beb50592abf).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209150350
**[Test build #55665 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55665/consoleFull)** for PR 12304 at commit [`0fa51bb`](https://github.com/apache/spark/commit/0fa51bb4c1ae98dd08c4ae46af4426aec2715de8).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209152803
**[Test build #55665 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55665/consoleFull)** for PR 12304 at commit [`0fa51bb`](https://github.com/apache/spark/commit/0fa51bb4c1ae98dd08c4ae46af4426aec2715de8).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209098321
Thanks for the PR. This reorg looks fine. I agree with what you said about del and active_spark_context.
My main request is that "JavaWrapperParams" be renamed to "JavaParams" to match JavaModel, JavaEstimator, etc.
Also, in util.py lines 102, 181: Update "JavaWrapper" to "JavaParams" in comments
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209145959
Merged build finished. Test FAILed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by sarangan12 <gi...@git.apache.org>.
Github user sarangan12 commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-208578449
Test comment
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-208521318
**[Test build #55532 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/55532/consoleFull)** for PR 12304 at commit [`c1d41c7`](https://github.com/apache/spark/commit/c1d41c7de25ba798abd4da5b342df15eede442b5).
* This patch passes all tests.
* This patch merges cleanly.
* This patch adds no public classes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by jkbradley <gi...@git.apache.org>.
Github user jkbradley commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209646012
LGTM
Merging with master
Thanks!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209153105
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55665/
Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by BryanCutler <gi...@git.apache.org>.
Github user BryanCutler commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-208507385
@jkbradley I noticed a couple of potential issues with current JavaCallable that I took care of here. First, trying to detach the Java object on `__del__` could cause a problem if the Python object was copied and one instance gets garbage collected. This would cause the remaining Python objects to have an invalid Java object reference, so I removed the call to detach. Second, assigning the Spark context in the constructor as `self._sc = SparkContext._active_spark_context` could be a problem if the Python object is created outside an active SparkContext and then the user does something to `_call_java` within a valid context. So I think it is better to only use `SparkContext._active_spark_context` when needed and calls will fail then if outside a valid context.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by BryanCutler <gi...@git.apache.org>.
Github user BryanCutler commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209140575
I made that change and fixed the comments in util.py
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209145962
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55661/
Test FAILed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-208521484
Merged build finished. Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-208521489
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/55532/
Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request: [SPARK-14472][PYSPARK][ML] Cleanup ML JavaWrap...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/12304#issuecomment-209153101
Merged build finished. Test PASSed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org