You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/11/30 03:01:46 UTC

[GitHub] [spark] Yikun commented on a change in pull request #34717: [SPARK-37465][PYTHON] Bump minimum pandas version to 1.0.5

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.




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