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/08/17 18:05:50 UTC

[GitHub] [spark] xinrong-databricks commented on a change in pull request #33757: [SPARK-36368][PYTHON] Fix CategoricalOps.astype to follow pandas 1.3

xinrong-databricks commented on a change in pull request #33757:
URL: https://github.com/apache/spark/pull/33757#discussion_r690605149



##########
File path: python/pyspark/pandas/tests/test_categorical.py
##########
@@ -243,18 +243,16 @@ def test_astype(self):
 
         self.assert_eq(kcser.astype("category"), pcser.astype("category"))
 
+        # CategoricalDtype is not updated if the dtype is same from pandas 1.3.
         if LooseVersion(pd.__version__) >= LooseVersion("1.3"):
-            # TODO(SPARK-36367): Fix the behavior to follow pandas >= 1.3
-            pass
-        elif LooseVersion(pd.__version__) >= LooseVersion("1.2"):
             self.assert_eq(
                 kcser.astype(CategoricalDtype(["b", "c", "a"])),
                 pcser.astype(CategoricalDtype(["b", "c", "a"])),
             )
         else:
             self.assert_eq(
                 kcser.astype(CategoricalDtype(["b", "c", "a"])),

Review comment:
       Shall we rename `kcser` to `pscser`? It's fine to do it in a separate PR though.




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