You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "itholic (via GitHub)" <gi...@apache.org> on 2023/07/03 09:04:05 UTC

[GitHub] [spark] itholic commented on a diff in pull request #41824: [SPARK-43570][SPARK-43571][PYTHON][TESTS] Enable DateOpsTests.[test_rsub|test_sub] for pandas 2.0.0.

itholic commented on code in PR #41824:
URL: https://github.com/apache/spark/pull/41824#discussion_r1250524246


##########
python/pyspark/pandas/tests/data_type_ops/test_date_ops.py:
##########
@@ -63,25 +63,25 @@ def test_add(self):
         for psser in self.pssers:
             self.assertRaises(TypeError, lambda: self.psser + psser)
 
-    @unittest.skipIf(
-        LooseVersion(pd.__version__) >= LooseVersion("2.0.0"),
-        "TODO(SPARK-43571): Enable DateOpsTests.test_sub for pandas 2.0.0.",
-    )
     def test_sub(self):
         self.assertRaises(TypeError, lambda: self.psser - "x")
         self.assertRaises(TypeError, lambda: self.psser - 1)
         self.assert_eq(
-            (self.pser - self.some_date).dt.days,
+            pd.to_timedelta(self.pser - self.some_date).dt.days,
             self.psser - self.some_date,

Review Comment:
   Yes, instead of just fixing it to work for testing, we need to modify the behavior to match pandas. However, we have decided to put this task on hold and address it in the next major release, Spark 4.0. For more details, please refer to the comment from SPARK-44101.
   
   IMHO, I'd recommend temporarily holding off on any tasks related to pandas 2.0.0 until starting to prepare Spark 4.0 release to avoid potential mistakes.



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