Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/5049#discussion_r26547652
--- Diff: python/pyspark/mllib/common.py ---
@@ -70,8 +70,8 @@ def _py2java(sc, obj):
obj = _to_java_object_rdd(obj)
elif isinstance(obj, SparkContext):
obj = obj._jsc
- elif isinstance(obj, list) and (obj or isinstance(obj[0], JavaObject)):
- obj = ListConverter().convert(obj, sc._gateway._gateway_client)
+ elif isinstance(obj, list):
+ obj = ListConverter().convert([_py2java(sc, x) for x in obj],
sc._gateway._gateway_client)
--- End diff --
Correct. Except that we pass in vectors because we call
`_convert_to_vector` in `KMeansModel.save`.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]