zero323 commented on a change in pull request #34513:
URL: https://github.com/apache/spark/pull/34513#discussion_r756781924
##########
File path: python/pyspark/mllib/stat/_statistics.py
##########
@@ -168,12 +190,34 @@ def corr(x, y=None, method=None):
raise TypeError("Use 'method=' to specify method name.")
if not y:
- return callMLlibFunc("corr", x.map(_convert_to_vector),
method).toArray()
+ return cast(
+ JavaObject, callMLlibFunc("corr", x.map(_convert_to_vector),
method)
+ ).toArray()
else:
- return callMLlibFunc("corr", x.map(float), y.map(float), method)
+ return cast(
+ Union[float, Matrix],
Review comment:
That's not `Union`. If you are in this specific branch, you have two
`RDD[float]` and result should be float.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]