Yicong-Huang commented on code in PR #58021:
URL: https://github.com/apache/spark/pull/58021#discussion_r3793935957
##########
python/pyspark/pandas/base.py:
##########
Review Comment:
I think the method's return expects `SeriesOrIndex` but the new result is
`Union[IndexOpsMixin, Tuple[IndexOpsMixin, ...]]`. And this cast makes it bear
the issue. maybe we should update the `__array_ufunc__`'s signature?
##########
python/pyspark/pandas/base.py:
##########
Review Comment:
Actually, can this cast work? The next caller would expect a single seriers
but would get a tuple instead for `modf` case.
##########
python/pyspark/pandas/tests/test_numpy_compat.py:
##########
@@ -264,6 +263,32 @@ def test_np_fmod(self):
self.assert_eq(np.fmod(psdf.x1, psdf.x2), np.fmod(pdf.x1, pdf.x2),
almost=True)
+ def test_np_modf(self):
+ # np.modf(x) returns a tuple (fractional part, integral part).
+ for pdf in (
Review Comment:
given that it claims to support Index and DataFrame, can we also add tests
for those inputs?
--
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]