Yikun commented on code in PR #36353:
URL: https://github.com/apache/spark/pull/36353#discussion_r920653546


##########
python/pyspark/pandas/tests/test_dataframe.py:
##########
@@ -1449,7 +1454,12 @@ def test_fillna(self):
         pdf.fillna({"x": -1, "y": -2, "z": -5}, inplace=True)
         psdf.fillna({"x": -1, "y": -2, "z": -5}, inplace=True)
         self.assert_eq(psdf, pdf)
-        self.assert_eq(psser, pser)
+        # SPARK-38946: Since Spark 3.4, fillna with inplace generate a new 
dataframe to follow
+        # pandas 1.4 behaviors
+        if LooseVersion(pd.__version__) >= LooseVersion("1.4"):
+            self.assert_eq(psser, pser)

Review Comment:
   See https://github.com/apache/spark/pull/36353#issuecomment-1178956945 , 
change the version to 1.4.0-1.4.2



##########
python/pyspark/pandas/tests/test_dataframe.py:
##########
@@ -2910,7 +2920,12 @@ def get_data(left_columns=None, right_columns=None):
         left_pdf.update(right_pdf)
         left_psdf.update(right_psdf)
         self.assert_eq(left_pdf.sort_values(by=["A", "B"]), 
left_psdf.sort_values(by=["A", "B"]))
-        self.assert_eq(psser.sort_index(), pser.sort_index())
+        # SPARK-38946: Since Spark 3.4, df.update generate a new dataframe to 
follow
+        # pandas 1.4 behaviors
+        if LooseVersion(pd.__version__) >= LooseVersion("1.4"):
+            self.assert_eq(psser.sort_index(), pser.sort_index())

Review Comment:
   See https://github.com/apache/spark/pull/36353#issuecomment-1178956945 , 
change the version to 1.4.0-1.4.2



##########
python/pyspark/pandas/tests/test_dataframe.py:
##########
@@ -5151,7 +5166,11 @@ def test_eval(self):
         pdf.eval("A = B + C", inplace=True)
         psdf.eval("A = B + C", inplace=True)
         self.assert_eq(pdf, psdf)
-        self.assert_eq(pser, psser)
+        # SPARK-38946: Since Pandas 1.4, eval with inplace generate a new 
dataframe
+        if LooseVersion(pd.__version__) >= LooseVersion("1.4"):
+            self.assert_eq(pser, psser)

Review Comment:
   See https://github.com/apache/spark/pull/36353#issuecomment-1178956945 , 
change the version to 1.4.0-1.4.2



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