Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions python/pyspark/pandas/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,7 @@ def append(self, other: "Index") -> "Index":
)
"""
from pyspark.pandas.indexes.multi import MultiIndex
from pyspark.pandas.indexes.category import CategoricalIndex

if isinstance(self, MultiIndex) != isinstance(other, MultiIndex):
raise NotImplementedError(
Expand All @@ -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())
Comment thread
itholic marked this conversation as resolved.

sdf_self = self._internal.spark_frame.select(self._internal.index_spark_columns)
sdf_other = other._internal.spark_frame.select(other._internal.index_spark_columns)
Expand Down