zhengruifeng commented on code in PR #37752:
URL: https://github.com/apache/spark/pull/37752#discussion_r961493174
##########
python/pyspark/rdd.py:
##########
@@ -1039,7 +1039,8 @@ def sample(
>>> 6 <= rdd.sample(False, 0.1, 81).count() <= 14
True
"""
- assert fraction >= 0.0, "Negative fraction value: %s" % fraction
+ if not fraction >= 0:
+ raise ValueError("Fraction must be nonnegative.")
Review Comment:
`AssertionError` is replaced with a `ValueError`, but I think it maybe
trivial to add it to migration-doc
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]