Yikun commented on a change in pull request #34717:
URL: https://github.com/apache/spark/pull/34717#discussion_r758894595



##########
File path: python/pyspark/pandas/tests/test_series.py
##########
@@ -2209,12 +2209,12 @@ def test_mad(self):
         pser = pd.Series([1, 2, 3, 4], name="Koalas")
         psser = ps.from_pandas(pser)
 
-        self.assert_eq(pser.mad(), psser.mad())
+        self.assert_eq(pser.mad(), psser.mad(), almost=True)

Review comment:
       Yep, I tried `self.assert_eq(pser.mad(), psser.mad(), 
check_exact=False)`, it failed again. Because the test.mad() result value type 
is a numpy.float64 scalar, it would be matched to:
   
   
https://github.com/apache/spark/blob/c38c617bcd04429e50310e4c7e0bd989c6555836/python/pyspark/testing/pandasutils.py#L237-L240
   
   So, only `almost=True` work.
   
   And I know your concern it's make sure the type is right in here, but not 
only to check value. I notice that only last check is failed in my env, so we 
can keep top 3 check as original, and just make last check as almost=True, and 
also add a note in here.




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