You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "HyukjinKwon (via GitHub)" <gi...@apache.org> on 2024/11/24 23:51:59 UTC

Re: [PR] [SPARK-50404][PYTHON] PySpark DataFrame Pipe Method [spark]

HyukjinKwon commented on code in PR #48947:
URL: https://github.com/apache/spark/pull/48947#discussion_r1855611571


##########
python/pyspark/sql/classic/dataframe.py:
##########
@@ -1699,6 +1700,19 @@ def transform(
         ), "Func returned an instance of type [%s], " "should have been DataFrame." % type(result)
         return result
 
+    def pipe(
+        self, *funcs: tuple[Callable[..., ParentDataFrame]]
+    ) -> ParentDataFrame:
+        result = functools.reduce(
+            lambda init, func: init.transform(func),

Review Comment:
   I would't add this API - it can be easily done at user side as you're demonstrating here.



-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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