diff --git a/python/pyspark/sql/functions.py b/python/pyspark/sql/functions.py index 3860076dd8f2c..03266138024cd 100644 --- a/python/pyspark/sql/functions.py +++ b/python/pyspark/sql/functions.py @@ -82,7 +82,7 @@ def _create_binary_mathfunction(name, doc=""): def _(col1, col2): sc = SparkContext._active_spark_context # For legacy reasons, the arguments here can be implicitly converted into floats, - # if they are not columns. + # if they are not columns or strings. if isinstance(col1, Column): arg1 = col1._jc elif isinstance(col1, basestring): diff --git a/python/pyspark/sql/tests/test_functions.py b/python/pyspark/sql/tests/test_functions.py index aab82534acaa0..b77757342843d 100644 --- a/python/pyspark/sql/tests/test_functions.py +++ b/python/pyspark/sql/tests/test_functions.py @@ -158,7 +158,7 @@ def test_rand_functions(self): def test_string_functions(self): from pyspark.sql import functions - from pyspark.sql.functions import col, lit, upper, _string_functions + from pyspark.sql.functions import col, lit, _string_functions df = self.spark.createDataFrame([['nick']], schema=['name']) self.assertRaisesRegexp( TypeError,