You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2018/12/31 12:29:14 UTC
[GitHub] chanansh commented on a change in pull request #23414: [Spark
26449][PYSPARK] add a transform method to the Dataframe class
chanansh commented on a change in pull request #23414: [Spark 26449][PYSPARK] add a transform method to the Dataframe class
URL: https://github.com/apache/spark/pull/23414#discussion_r244580590
##########
File path: python/pyspark/sql/dataframe.py
##########
@@ -2045,7 +2045,46 @@ def toDF(self, *cols):
"""
jdf = self._jdf.toDF(self._jseq(cols))
return DataFrame(jdf, self.sql_ctx)
-
+
+ @since(3.0)
+ def transform(self, func, *args, **kwargs):
+ """Returns a new class:`DataFrame` according to a user-defined custom transform method.
+ This allows chaining transformations rather than using nested or temporary variables.
+
+ :param func: a user-defined custom transform function
+ :param *args: optional positional arguments to pass to `func`
+ :param **kwargs: optional keywarded arguments to pass to `func`
+
+ A more concrete example::
Review comment:
can you please provide an example?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org