zhengruifeng commented on code in PR #41947:
URL: https://github.com/apache/spark/pull/41947#discussion_r1263202873
##########
python/pyspark/testing/utils.py:
##########
@@ -336,7 +353,7 @@ def compare_vals(val1, val2):
and all(compare_vals(val1[k], val2[k]) for k in
val1.keys())
)
elif isinstance(val1, float) and isinstance(val2, float):
- if abs(val1 - val2) > 1e-5:
+ if abs(val1 - val2) > (atol + rtol * abs(val2)):
Review Comment:
is it possible to directly use the `np.allclose` here?
maybe a few special values to consider: float('nan'), float('inf'),
float('-inf')
--
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]