spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdblue <...@git.apache.org>
Subject [GitHub] spark issue #16533: [SPARK-19160][PYTHON][SQL][WIP] Add udf decorator
Date Thu, 19 Jan 2017 19:31:12 GMT
Github user rdblue commented on the issue:

    https://github.com/apache/spark/pull/16533
  
    @zero323, I think that the decorator and existing UDF factory method should be the same,
but that we can't break existing code. Can you explain why this necessarily breaks code that
relies on returnType as a positional arg? What about something like this:
    
    ```python
    @functools.wraps(_udf)
    def udf(f=None, returnType=StringType()):
        """A decorator version of pyspark.sql.functions.udf
        """
        if f is None:
            return functools.partial(_udf, returnType=returnType)
        else:
            return _udf(f=f, returnType=returnType)
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message