asl3 commented on code in PR #42332:
URL: https://github.com/apache/spark/pull/42332#discussion_r1283898250


##########
python/pyspark/sql/tests/test_utils.py:
##########
@@ -746,28 +748,123 @@ def test_assert_unequal_null_expected(self):
         )
 
     def test_assert_equal_exact_pandas_df(self):
+        df1 = pd.DataFrame(
+            data=np.array([(1, 2, 3), (4, 5, 6), (7, 8, 9)]), columns=["a", 
"b", "c"]
+        )
+        df2 = pd.DataFrame(
+            data=np.array([(1, 2, 3), (4, 5, 6), (7, 8, 9)]), columns=["a", 
"b", "c"]
+        )
+
+        assertDataFrameEqual(df1, df2, checkRowOrder=False)

Review Comment:
   @zhengruifeng Yes, since `assertDataFrameEqual` asserts approximate equality 
by default for float-like values, it will call the 
[pandasutils.py](https://github.com/apache/spark/blob/4ed59d932631ba819d6b6071ee91408622a312db/python/pyspark/testing/pandasutils.py#L4)
 `_assert_pandas_almost_equal` util to assert approximate equality for 
float-like vals (instead of the pandasutils.py `_assert_pandas_equal`, which 
has the same behavior as pandas assert_frame_equal). 
   
   The `assertPandasOnSparkEqual` from pandasutils.py calls 
`_assert_pandas_equal` or `_assert_pandas_almost_equal` depending on user config



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

Reply via email to