srowen commented on a change in pull request #18906: 
[SPARK-21692][PYSPARK][SQL] Add nullability support to PythonUDF.
URL: https://github.com/apache/spark/pull/18906#discussion_r357981139
 
 

 ##########
 File path: python/pyspark/sql/udf.py
 ##########
 @@ -163,14 +164,26 @@ def wrapper(*args):
         wrapper.returnType = self.returnType
         wrapper.evalType = self.evalType
         wrapper.asNondeterministic = self.asNondeterministic
+        wrapper.asNonNullable = functools.wraps(
+            self.asNonNullable)(lambda: self.asNonNullable()._wrapped())
+        wrapper.nullable = self.nullable
 
         return wrapper
 
     def asNondeterministic(self):
         """
-        Updates UserDefinedFunction to nondeterministic.
+        Updates :class:`UserDefinedFunction` to nondeterministic.
 
         .. versionadded:: 2.3
         """
         self._deterministic = False
         return self
+
+    def asNonNullable(self):
+        """
+        Updates :class:`UserDefinedFunction` to non-nullable.
+
+        .. versionadded:: 2.4
 
 Review comment:
   3.0?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to