Skip to content

Commit d92dac3

Browse files
committed
Adds the doc for asNondeterministic for wrapped UDF function
1 parent f2dd8b9 commit d92dac3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

python/pyspark/sql/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ def test_nondeterministic_udf2(self):
413413
pydoc.render_doc(udf(lambda: random.randint(6, 6), IntegerType()))
414414
pydoc.render_doc(random_udf)
415415
pydoc.render_doc(random_udf1)
416+
pydoc.render_doc(udf(lambda x: x).asNondeterministic)
416417

417418
def test_nondeterministic_udf_in_aggregate(self):
418419
from pyspark.sql.functions import udf, sum

python/pyspark/sql/udf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def wrapper(*args):
169169
wrapper.returnType = self.returnType
170170
wrapper.evalType = self.evalType
171171
wrapper.deterministic = self.deterministic
172-
wrapper.asNondeterministic = lambda: self.asNondeterministic()._wrapped()
173-
172+
wrapper.asNondeterministic = functools.wraps(
173+
self.asNondeterministic)(lambda: self.asNondeterministic()._wrapped())
174174
return wrapper
175175

176176
def asNondeterministic(self):

0 commit comments

Comments
 (0)