Skip to content

Commit d17d634

Browse files
author
Davies Liu
committed
rollback changes in mllib
1 parent 2e7566d commit d17d634

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/pyspark/mllib/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import py4j.protocol
2424
from py4j.protocol import Py4JJavaError
2525
from py4j.java_gateway import JavaObject
26-
from py4j.java_collections import JavaArray, JavaList
26+
from py4j.java_collections import ListConverter, JavaArray, JavaList
2727

2828
from pyspark import RDD, SparkContext
2929
from pyspark.serializers import PickleSerializer, AutoBatchedSerializer
@@ -76,7 +76,7 @@ def _py2java(sc, obj):
7676
elif isinstance(obj, SparkContext):
7777
obj = obj._jsc
7878
elif isinstance(obj, list):
79-
obj = [_py2java(sc, x) for x in obj]
79+
obj = ListConverter().convert([_py2java(sc, x) for x in obj], sc._gateway._gateway_client)
8080
elif isinstance(obj, JavaObject):
8181
pass
8282
elif isinstance(obj, (int, long, float, bool, bytes, unicode)):

0 commit comments

Comments
 (0)