You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/03/05 17:26:51 UTC

[GitHub] [spark] srowen opened a new pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

srowen opened a new pull request #31760:
URL: https://github.com/apache/spark/pull/31760


   ### What changes were proposed in this pull request?
   
   Fix a call to setParams in the Linear Regression docs example in Pyspark to avoid a TypeError.
   
   ### Why are the changes needed?
   
   The example is slightly wrong and we should not show an error in the docs.
   
   ### Does this PR introduce _any_ user-facing change?
   
   None
   
   ### How was this patch tested?
   
   Existing tests


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791950885


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135828/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun closed pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun closed pull request #31760:
URL: https://github.com/apache/spark/pull/31760


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791648532


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40400/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791617418






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA removed a comment on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
SparkQA removed a comment on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791941022


   **[Test build #135828 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135828/testReport)** for PR 31760 at commit [`27b59d8`](https://github.com/apache/spark/commit/27b59d8ca92aca6c7712516ab4ce4ef891547e52).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] dongjoon-hyun commented on a change in pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
dongjoon-hyun commented on a change in pull request #31760:
URL: https://github.com/apache/spark/pull/31760#discussion_r588589297



##########
File path: python/pyspark/ml/regression.py
##########
@@ -180,10 +180,7 @@ class LinearRegression(_JavaRegressor, _LinearRegressionParams, JavaMLWritable,
     >>> test1 = spark.createDataFrame([(Vectors.sparse(1, [0], [1.0]),)], ["features"])
     >>> abs(model.transform(test1).head().newPrediction - 1.0) < 0.001
     True
-    >>> lr.setParams("vector")
-    Traceback (most recent call last):
-        ...
-    TypeError: Method setParams forces keyword arguments.
+    >>> lr.setParams(featuresCol="vector")

Review comment:
       Hi, @srowen . +1 for removing this ancient `TypeError` example (added 5 year ago). In this case, we can do partial check like the following.
   ```python
   >>> lr.setParams(featuresCol="vector")
   LinearRegression...
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791949598


   **[Test build #135828 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135828/testReport)** for PR 31760 at commit [`27b59d8`](https://github.com/apache/spark/commit/27b59d8ca92aca6c7712516ab4ce4ef891547e52).
    * This patch passes all tests.
    * This patch merges cleanly.
    * This patch adds no public classes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] HyukjinKwon commented on a change in pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
HyukjinKwon commented on a change in pull request #31760:
URL: https://github.com/apache/spark/pull/31760#discussion_r588855067



##########
File path: python/pyspark/ml/regression.py
##########
@@ -180,10 +180,7 @@ class LinearRegression(_JavaRegressor, _LinearRegressionParams, JavaMLWritable,
     >>> test1 = spark.createDataFrame([(Vectors.sparse(1, [0], [1.0]),)], ["features"])
     >>> abs(model.transform(test1).head().newPrediction - 1.0) < 0.001
     True
-    >>> lr.setParams("vector")
-    Traceback (most recent call last):
-        ...
-    TypeError: Method setParams forces keyword arguments.
+    >>> lr.setParams(featuresCol="vector")

Review comment:
       Yeah ^^ seems correct




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins removed a comment on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
AmplabJenkins removed a comment on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791968239


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40410/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791965200


   Kubernetes integration test status failure
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40410/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791952672


   Kubernetes integration test starting
   URL: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder-K8s/40410/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] SparkQA commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
SparkQA commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791941022


   **[Test build #135828 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/135828/testReport)** for PR 31760 at commit [`27b59d8`](https://github.com/apache/spark/commit/27b59d8ca92aca6c7712516ab4ce4ef891547e52).


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791617418


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/135818/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] AmplabJenkins commented on pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
AmplabJenkins commented on pull request #31760:
URL: https://github.com/apache/spark/pull/31760#issuecomment-791968239


   
   Refer to this link for build results (access rights to CI server needed): 
   https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder-K8s/40410/
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] srowen commented on a change in pull request #31760: [SPARK-34642][DOCS][ML] Fix TypeError in Pyspark Linear Regression docs

Posted by GitBox <gi...@apache.org>.
srowen commented on a change in pull request #31760:
URL: https://github.com/apache/spark/pull/31760#discussion_r588499834



##########
File path: python/pyspark/ml/regression.py
##########
@@ -180,10 +180,7 @@ class LinearRegression(_JavaRegressor, _LinearRegressionParams, JavaMLWritable,
     >>> test1 = spark.createDataFrame([(Vectors.sparse(1, [0], [1.0]),)], ["features"])
     >>> abs(model.transform(test1).head().newPrediction - 1.0) < 0.001
     True
-    >>> lr.setParams("vector")
-    Traceback (most recent call last):
-        ...
-    TypeError: Method setParams forces keyword arguments.
+    >>> lr.setParams(featuresCol="vector")

Review comment:
       @HyukjinKwon is it correct here just to specify no output from this command? I don't think we care about testing any output of this. I don't know how python docs work though :)




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org