aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/ml/tests.py
diff options
context:
space:
mode:
authorJoseph K. Bradley <joseph@databricks.com>2016-04-15 11:50:21 -0700
committerJoseph K. Bradley <joseph@databricks.com>2016-04-15 11:50:21 -0700
commitd6ae7d4637d23c57c4eeab79d1177216f380ec9c (patch)
tree0779a958d56eb4d7664c5cf3fe238aa42b94a2af /python/pyspark/ml/tests.py
parent83af297ac42546580983f91079f74e3a4cf25050 (diff)
downloadspark-d6ae7d4637d23c57c4eeab79d1177216f380ec9c.tar.gz
spark-d6ae7d4637d23c57c4eeab79d1177216f380ec9c.tar.bz2
spark-d6ae7d4637d23c57c4eeab79d1177216f380ec9c.zip
[SPARK-14665][ML][PYTHON] Fixed bug with StopWordsRemover default stopwords
## What changes were proposed in this pull request? The default stopwords were a Java object. They are no longer. ## How was this patch tested? Unit test which failed before the fix Author: Joseph K. Bradley <joseph@databricks.com> Closes #12422 from jkbradley/pyspark-stopwords.
Diffstat (limited to 'python/pyspark/ml/tests.py')
-rw-r--r--python/pyspark/ml/tests.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/pyspark/ml/tests.py b/python/pyspark/ml/tests.py
index 86c0254a2b..85ad949c5a 100644
--- a/python/pyspark/ml/tests.py
+++ b/python/pyspark/ml/tests.py
@@ -22,6 +22,7 @@ import array
import sys
if sys.version > '3':
xrange = range
+ basestring = str
try:
import xmlrunner
@@ -398,6 +399,8 @@ class FeatureTests(PySparkTestCase):
self.assertEqual(stopWordRemover.getInputCol(), "input")
transformedDF = stopWordRemover.transform(dataset)
self.assertEqual(transformedDF.head().output, ["panda"])
+ self.assertEqual(type(stopWordRemover.getStopWords()), list)
+ self.assertTrue(isinstance(stopWordRemover.getStopWords()[0], basestring))
# Custom
stopwords = ["panda"]
stopWordRemover.setStopWords(stopwords)