Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21383#discussion_r191437141
  
    --- Diff: python/pyspark/sql/udf.py ---
    @@ -157,7 +157,17 @@ def _create_judf(self):
             spark = SparkSession.builder.getOrCreate()
             sc = spark.sparkContext
     
    -        wrapped_func = _wrap_function(sc, self.func, self.returnType)
    +        func = fail_on_stopiteration(self.func)
    +
    +        # prevent inspect to fail
    +        # e.g. inspect.getargspec(sum) raises
    +        # TypeError: <built-in function sum> is not a Python function
    +        try:
    +            func._argspec = _get_argspec(self.func)
    +        except TypeError:
    --- End diff --
    
    Let's use all of Pandas UDFs:
    
    
https://github.com/apache/spark/blob/a9350d7095b79c8374fb4a06fd3f1a1a67615f6f/python/pyspark/sql/udf.py#L40-L67


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to