zhengruifeng commented on code in PR #38015:
URL: https://github.com/apache/spark/pull/38015#discussion_r980909404
##########
python/pyspark/pandas/indexes/base.py:
##########
@@ -1907,6 +1908,9 @@ def append(self, other: "Index") -> "Index":
)
index_fields = self._index_fields_for_union_like(other,
func_name="append")
+ # Since pandas 1.5.0, the order of category matters.
+ if isinstance(other, CategoricalIndex):
+ other = other.reorder_categories(self.categories.to_list())
Review Comment:
shall we check the version, and only call `reorder_categories` when version
>= 1.5.0?
or this `reorder_categories` also work with 1.4.x?
--
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]