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 2022/10/19 20:17:52 UTC

[GitHub] [spark] amaliujia commented on a diff in pull request #38310: [SPARK-40839][CONNECT][PYTHON] Implement `DataFrame.sample`

amaliujia commented on code in PR #38310:
URL: https://github.com/apache/spark/pull/38310#discussion_r999895806


##########
python/pyspark/sql/connect/dataframe.py:
##########
@@ -201,6 +202,34 @@ def sort(self, *cols: "ColumnOrString") -> "DataFrame":
         """Sort by a specific column"""
         return DataFrame.withPlan(plan.Sort(self._plan, *cols), session=self._session)
 
+    def sample(
+        self,
+        withReplacement: Optional[Union[float, bool]] = None,
+        fraction: Optional[Union[int, float]] = None,
+        seed: Optional[int] = None,
+    ) -> "DataFrame":
+        from pyspark.sql import DataFrame as PySparkDataFrame

Review Comment:
   yes this is now depending on the pyspark. In fact since the first PR.  For the short term it is ok cc @HyukjinKwon 
   
   I guess we will need to make a final decision how whether it should depend or not before making the python packaging and release. 



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