From 3ba175ef9a5c011a48d8f5e4f6ab6b21e7f5377b Mon Sep 17 00:00:00 2001 From: HyukjinKwon Date: Tue, 7 Jan 2020 10:13:40 +0900 Subject: [PATCH] [SPARK-30430][PYTHON][DOCS] Add a note that UserDefinedFunction's constructor is private ### What changes were proposed in this pull request? This PR adds a note that UserDefinedFunction's constructor is private. ### Why are the changes needed? To match with Scala side. Scala side does not have it at all. ### Does this PR introduce any user-facing change? Doc only changes but it declares UserDefinedFunction's constructor is private explicitly. ### How was this patch tested? Jenkins Closes #27101 from HyukjinKwon/SPARK-30430. Authored-by: HyukjinKwon Signed-off-by: HyukjinKwon --- python/pyspark/sql/udf.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/pyspark/sql/udf.py b/python/pyspark/sql/udf.py index c4d7c1ed20..3557c9b1ff 100644 --- a/python/pyspark/sql/udf.py +++ b/python/pyspark/sql/udf.py @@ -84,6 +84,10 @@ class UserDefinedFunction(object): User defined function in Python .. versionadded:: 1.3 + + .. note:: The constructor of this class is not supposed to be directly called. + Use :meth:`pyspark.sql.functions.udf` or :meth:`pyspark.sql.functions.pandas_udf` + to create this instance. """ def __init__(self, func, returnType=StringType(),