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/06 05:22:11 UTC
[GitHub] [spark] itholic commented on a change in pull request #33634: [SPARK-36369][PYTHON] Fix Index.union to follow pandas 1.3
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.
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: 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