Github user ueshin commented on a diff in the pull request:
https://github.com/apache/spark/pull/20171#discussion_r161711980
--- Diff: python/pyspark/sql/tests.py ---
@@ -4037,6 +4082,15 @@ def test_simple(self):
expected =
df.toPandas().groupby('id').apply(foo_udf.func).reset_index(drop=True)
self.assertFramesEqual(expected, result)
+ def test_register_group_map_udf(self):
+ from pyspark.sql.functions import pandas_udf, PandasUDFType
+
+ foo_udf = pandas_udf(lambda x: x, "id long",
PandasUDFType.GROUP_MAP)
+ with QuietTest(self.sc):
+ with self.assertRaisesRegexp(ValueError, 'f must be either
SQL_BATCHED_UDF or '
+
'SQL_PANDAS_SCALAR_UDF'):
+ self.spark.catalog.registerFunction("foo_udf", foo_udf)
--- End diff --
ditto.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]