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 2023/07/03 00:23:48 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #41787: [SPARK-44245][PYTHON] pyspark.sql.dataframe doctests behave differently

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


##########
python/pyspark/sql/dataframe.py:
##########
@@ -1873,11 +1873,11 @@ def sample(  # type: ignore[misc]
         Examples
         --------
         >>> df = spark.range(10)
-        >>> df.sample(0.5, 3).count()
+        >>> df.sample(0.5, 3).count() # doctest: +SKIP
         7
-        >>> df.sample(fraction=0.5, seed=3).count()
+        >>> df.sample(fraction=0.5, seed=3).count() # doctest: +SKIP
         7
-        >>> df.sample(withReplacement=True, fraction=0.5, seed=3).count()
+        >>> df.sample(withReplacement=True, fraction=0.5, seed=3).count() # doctest: +SKIP

Review Comment:
   The result is deterministic as long as 1. seed is same, and 2. the number of partitions in the originated DataFrame. I agree with the change in a way that you might want to run this doctest with a different env but Python version shouldn't be a valid reason for it. Please either elaborate it, or fix the PR description. LGTM otherwise.



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