Skip to content

Commit e8615c2

Browse files
committed
Add return annotation to catalog.registerFunction and fix style
1 parent 9edc5e9 commit e8615c2

File tree

3 files changed

+2
-2
lines changed

3 files changed

+2
-2
lines changed

python/pyspark/sql/catalog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ def registerFunction(self, name, f, returnType=StringType()):
237237
:param name: name of the UDF
238238
:param f: python function
239239
:param returnType: a :class:`pyspark.sql.types.DataType` object
240+
:return a wrapped :class:`UserDefinedFunction`
240241
241242
>>> strlen = spark.catalog.registerFunction("stringLengthString", len)
242243
>>> spark.sql("SELECT stringLengthString('test')").collect()

python/pyspark/sql/context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def registerFunction(self, name, f, returnType=StringType()):
185185
:param name: name of the UDF
186186
:param f: python function
187187
:param returnType: a :class:`pyspark.sql.types.DataType` object
188-
:return a wrapped :class:`UserDefinedFunction`
188+
:return a wrapped :class:`UserDefinedFunction`
189189
190190
>>> strlen = sqlContext.registerFunction("stringLengthString", lambda x: len(x))
191191
>>> sqlContext.sql("SELECT stringLengthString('test')").collect()

python/pyspark/sql/tests.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ def f(x):
624624
self.assertEqual(f, f_.func)
625625
self.assertEqual(return_type, f_.returnType)
626626

627-
628627
def test_basic_functions(self):
629628
rdd = self.sc.parallelize(['{"foo":"bar"}', '{"foo":"baz"}'])
630629
df = self.spark.read.json(rdd)

0 commit comments

Comments
 (0)