aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/ml/common.py
diff options
context:
space:
mode:
authorJason White <jason.white@shopify.com>2016-10-03 14:12:03 -0700
committerDavies Liu <davies.liu@gmail.com>2016-10-03 14:12:03 -0700
commit1f31bdaef670dd43999613deae3620f4ddcd1fbf (patch)
tree0814b539f497beddf89f2421e90aa93d0bf83c6b /python/pyspark/ml/common.py
parent1dd68d3827133d203e85294405400b04904879e0 (diff)
downloadspark-1f31bdaef670dd43999613deae3620f4ddcd1fbf.tar.gz
spark-1f31bdaef670dd43999613deae3620f4ddcd1fbf.tar.bz2
spark-1f31bdaef670dd43999613deae3620f4ddcd1fbf.zip
[SPARK-17679] [PYSPARK] remove unnecessary Py4J ListConverter patch
## What changes were proposed in this pull request? This PR removes a patch on ListConverter from https://github.com/apache/spark/pull/5570, as it is no longer necessary. The underlying issue in Py4J https://github.com/bartdag/py4j/issues/160 was patched in https://github.com/bartdag/py4j/commit/224b94b6665e56a93a064073886e1d803a4969d2 and is present in 0.10.3, the version currently in use in Spark. ## How was this patch tested? The original test added in https://github.com/apache/spark/pull/5570 remains. Author: Jason White <jason.white@shopify.com> Closes #15254 from JasonMWhite/remove_listconverter_patch.
Diffstat (limited to 'python/pyspark/ml/common.py')
-rw-r--r--python/pyspark/ml/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/pyspark/ml/common.py b/python/pyspark/ml/common.py
index aec860fca7..387c5d7309 100644
--- a/python/pyspark/ml/common.py
+++ b/python/pyspark/ml/common.py
@@ -23,7 +23,7 @@ if sys.version >= '3':
import py4j.protocol
from py4j.protocol import Py4JJavaError
from py4j.java_gateway import JavaObject
-from py4j.java_collections import ListConverter, JavaArray, JavaList
+from py4j.java_collections import JavaArray, JavaList
from pyspark import RDD, SparkContext
from pyspark.serializers import PickleSerializer, AutoBatchedSerializer
@@ -76,7 +76,7 @@ def _py2java(sc, obj):
elif isinstance(obj, SparkContext):
obj = obj._jsc
elif isinstance(obj, list):
- obj = ListConverter().convert([_py2java(sc, x) for x in obj], sc._gateway._gateway_client)
+ obj = [_py2java(sc, x) for x in obj]
elif isinstance(obj, JavaObject):
pass
elif isinstance(obj, (int, long, float, bool, bytes, unicode)):