dgd-contributor commented on a change in pull request #33911:
URL: https://github.com/apache/spark/pull/33911#discussion_r706141164
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_boolean_ops.py
##########
@@ -286,6 +287,32 @@ def test_ror(self):
self.assert_eq(True | pser, True | psser)
self.assert_eq(False | pser, False | psser)
+ def test_xor(self):
+ pdf, psdf = self.bool_pdf, self.bool_psdf
+ pser, other_pser = pdf["this"], pdf["that"]
+ psser, other_psser = psdf["this"], psdf["that"]
+
+ self.assert_eq(pser ^ other_pser, psser ^ other_psser)
+ self.assert_eq(pser ^ True, psser ^ True)
+ self.assert_eq(pser ^ False, psser ^ False)
+ self.assert_eq(pser ^ 2, psser ^ 2)
+ self.assert_eq(pser ^ 99, psser ^ 99)
+
+ with self.assertRaisesRegex(TypeError, "XOR can not be applied to
given types."):
+ psser ^ "a"
+
+ with option_context("compute.ops_on_diff_frames", True):
+ pser, other_pser = self.pdf["bool"], self.integral_pdf["this"]
+ psser, other_psser = self.psdf["bool"], self.integral_psdf["this"]
+
+ self.assert_eq(pser ^ other_pser, psser ^ other_psser)
+
+ def test_rxor(self):
+ pser, psser = self.pdf["bool"], self.psdf["bool"]
+ self.assert_eq(True ^ pser, True ^ psser)
+ self.assert_eq(False ^ pser, False ^ psser)
+ self.assert_eq(1 ^ pser, 1 ^ psser)
Review comment:
thanks you, updated. I also added ```xor``` in
```BooleanExtensionOps```, please take a look when you have time.
--
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]