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/07 22:57:45 UTC

[GitHub] [spark] ueshin commented on a change in pull request #33911: [SPARK-36653][PYTHON] implement Series.__xor__ and Series.__rxor__

ueshin commented on a change in pull request #33911:
URL: https://github.com/apache/spark/pull/33911#discussion_r703817983



##########
File path: python/pyspark/pandas/base.py
##########
@@ -422,12 +422,18 @@ def __and__(self, other: Any) -> SeriesOrIndex:
     def __or__(self, other: Any) -> SeriesOrIndex:
         return self._dtype_op.__or__(self, other)
 
+    def __xor__(self, other: Any) -> SeriesOrIndex:
+        return self._dtype_op.__xor__(self, other)

Review comment:
       Shall we just use `xor` as the method name if it's usable?

##########
File path: python/pyspark/pandas/base.py
##########
@@ -422,12 +422,18 @@ def __and__(self, other: Any) -> SeriesOrIndex:
     def __or__(self, other: Any) -> SeriesOrIndex:
         return self._dtype_op.__or__(self, other)
 
+    def __xor__(self, other: Any) -> SeriesOrIndex:

Review comment:
       Shall we have this in `Series`?
   `Index.__xor__` has a different implementation now.

##########
File path: python/pyspark/pandas/base.py
##########
@@ -422,12 +422,18 @@ def __and__(self, other: Any) -> SeriesOrIndex:
     def __or__(self, other: Any) -> SeriesOrIndex:
         return self._dtype_op.__or__(self, other)
 
+    def __xor__(self, other: Any) -> SeriesOrIndex:
+        return self._dtype_op.__xor__(self, other)
+
     def __rand__(self, other: Any) -> SeriesOrIndex:
         return self._dtype_op.rand(self, other)
 
     def __ror__(self, other: Any) -> SeriesOrIndex:
         return self._dtype_op.ror(self, other)
 
+    def __rxor__(self, other: Any) -> SeriesOrIndex:

Review comment:
       ditto.

##########
File path: python/pyspark/pandas/base.py
##########
@@ -422,12 +422,18 @@ def __and__(self, other: Any) -> SeriesOrIndex:
     def __or__(self, other: Any) -> SeriesOrIndex:
         return self._dtype_op.__or__(self, other)
 
+    def __xor__(self, other: Any) -> SeriesOrIndex:

Review comment:
       Or we can override `Index.__rxor__`; otherwise `Index.__rxor__` uses this implementation.
   Anyway this is related to #33844. cc @itholic 




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