itholic commented on a change in pull request #33634:
URL: https://github.com/apache/spark/pull/33634#discussion_r683955183
##########
File path: python/pyspark/pandas/indexes/base.py
##########
@@ -2292,9 +2292,7 @@ def union(
sdf_self =
self._internal.spark_frame.select(self._internal.index_spark_columns)
sdf_other =
other_idx._internal.spark_frame.select(other_idx._internal.index_spark_columns)
- sdf = sdf_self.union(sdf_other.subtract(sdf_self))
- if isinstance(self, MultiIndex):
- sdf = sdf.drop_duplicates()
+ sdf =
sdf_self.unionAll(sdf_other).exceptAll(sdf_self.intersectAll(sdf_other))
if sort:
Review comment:
Thanks, @HyukjinKwon !
Seems like they said "dropping duplicate Index values" was a bug, and fixed
in this release.
Related discussion was made at
https://github.com/pandas-dev/pandas/issues/36289 and
https://github.com/pandas-dev/pandas/issues/31326.
Also checked the `sort` and drop duplicates, works the same as pandas.
--
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]