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/09/27 10:51:06 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #34114: [SPARK-36438][PYTHON] Support list-like Python objects for Series comparison

HyukjinKwon commented on a change in pull request #34114:
URL: https://github.com/apache/spark/pull/34114#discussion_r716576916



##########
File path: python/pyspark/pandas/base.py
##########
@@ -394,7 +394,17 @@ def __abs__(self: IndexOpsLike) -> IndexOpsLike:
 
     # comparison operators
     def __eq__(self, other: Any) -> SeriesOrIndex:  # type: ignore[override]
-        return self._dtype_op.eq(self, other)
+        if isinstance(other, (list, tuple)):
+            with ps.option_context("compute.ordered_head", True):
+                pindex_ops = self.head(len(other) + 1)._to_internal_pandas()  # type: ignore

Review comment:
       can we avoid collecting `self` to compare?




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