xinrong-databricks commented on a change in pull request #32611:
URL: https://github.com/apache/spark/pull/32611#discussion_r638127919
##########
File path: python/pyspark/pandas/tests/data_type_ops/test_boolean_ops.py
##########
@@ -33,107 +35,148 @@ def pser(self):
def psser(self):
return ps.from_pandas(self.pser)
+ @property
+ def float_pser(self):
+ return pd.Series([1, 2, 3], dtype=float)
+
+ @property
+ def float_psser(self):
+ return ps.from_pandas(self.float_pser)
+
def test_add(self):
- self.assertRaises(TypeError, lambda: self.psser + 1)
- self.assertRaises(TypeError, lambda: self.psser + 0.1)
+ self.assert_eq(self.pser + 1, self.psser + 1)
+ self.assert_eq(self.pser + 0.1, self.psser + 0.1)
Review comment:
Arithmetic operations between`psser` and `psser.astype(int)` are tested.
`psser + psser` will raise `TypeError`, while pandas treat it as `__and__`.
A follow-up PR might be needed to support it. Would you prefer it to be
implemented in this PR?
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]