You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "allisonwang-db (via GitHub)" <gi...@apache.org> on 2023/07/27 17:02:09 UTC
[GitHub] [spark] allisonwang-db commented on a diff in pull request #42157: [SPARK-43968][PYTHON] Improve error messages for Python UDTFs with wrong number of outputs
allisonwang-db commented on code in PR #42157:
URL: https://github.com/apache/spark/pull/42157#discussion_r1276577525
##########
python/pyspark/sql/tests/test_udtf.py:
##########
@@ -256,29 +254,76 @@ def eval(self, a: int):
):
TestUDTF(lit(1), lit(2)).collect()
+ def test_udtf_init_with_additional_args(self):
+ @udtf(returnType="x int")
+ class TestUDTF:
+ def __init__(self, a: int):
+ ...
+
+ def eval(self, a: int):
+ yield a,
+
+ with self.assertRaisesRegex(
+ PythonException, r"__init__\(\) missing 1 required positional argument: 'a'"
Review Comment:
Yup here is the Jira ticket to add UDTF name in the error message: https://issues.apache.org/jira/browse/SPARK-44008
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org