Github user icexelloss commented on a diff in the pull request:
https://github.com/apache/spark/pull/22620#discussion_r222411585
--- Diff: python/pyspark/sql/udf.py ---
@@ -298,6 +298,15 @@ def register(self, name, f, returnType=None):
>>> spark.sql("SELECT add_one(id) FROM range(3)").collect() #
doctest: +SKIP
[Row(add_one(id)=1), Row(add_one(id)=2), Row(add_one(id)=3)]
+ >>> @pandas_udf("integer", PandasUDFType.GROUPED_AGG) #
doctest: +SKIP
+ ... def sum_udf(v):
+ ... return v.sum()
+ ...
+ >>> _ = spark.udf.register("sum_udf", sum_udf) # doctest:
+SKIP
--- End diff --
what is the "_ =" thing here?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]