Github user HyukjinKwon commented on the issue: https://github.com/apache/spark/pull/20137 With this diff: ```diff diff --git a/python/pyspark/sql/udf.py b/python/pyspark/sql/udf.py index 54b5a8656e1..24de9839e90 100644 --- a/python/pyspark/sql/udf.py +++ b/python/pyspark/sql/udf.py @@ -162,7 +162,8 @@ class UserDefinedFunction(object): wrapper.func = self.func wrapper.returnType = self.returnType wrapper.evalType = self.evalType - wrapper.asNondeterministic = self.asNondeterministic + wrapper.asNondeterministic = lambda: self.asNondeterministic()._wrapped() + wrapper._unwrapped = lambda: self return wrapper ``` **Before** ```python from pyspark.sql.functions import udf help(udf(lambda: 1, "integer").asNondeterministic()) ``` ``` Help on UserDefinedFunction in module pyspark.sql.udf object: class UserDefinedFunction(__builtin__.object) | User defined function in Python | | .. versionadded:: 1.3 | | Methods defined here: | | __call__(self, *cols) | | __init__(self, func, returnType=StringType, name=None, evalType=100) | | asNondeterministic(self) | Updates UserDefinedFunction to nondeterministic. | | .. versionadded:: 2.3 | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables (if defined) | | __weakref__ | list of weak references to the object (if defined) | : ``` ```python from pyspark.sql.functions import udf help(udf(lambda: 1, "integer")) ``` ``` Help on function <lambda> in module __main__: <lambda> lambda *args (END) ``` **After** ```python from pyspark.sql.functions import udf help(udf(lambda: 1, "integer").asNondeterministic()) ``` ``` Help on function <lambda> in module __main__: <lambda> lambda *args (END) ``` ```python from pyspark.sql.functions import udf help(udf(lambda: 1, "integer")) ``` ``` Help on function <lambda> in module __main__: <lambda> lambda *args (END) ```
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org