Spenserrrr commented on code in PR #58021: URL: https://github.com/apache/spark/pull/58021#discussion_r3794724936
########## python/pyspark/pandas/base.py: ########## Review Comment: I updated the type annotation and __array_ufunc__'s return type is now Union[SeriesOrIndex, Tuple[SeriesOrIndex, ...]] rather than casting the tuple down to a single SeriesOrIndex. On the question of the next caller, for a Series/Index, the caller of __array_ufunc__ is NumPy's ufunc machinery, which for a multi-output ufunc expects a tuple and returns it to the user unchanged, so fractional, integral = np.modf(psser) unpacks correctly. The caller that did assume a single Series is exactly the one you mentioned, which is DataFrame.__array_ufunc__. It applies the ufunc per column and renames each result, so it originally didn't work for a multi-output ufunc. It's now fixed to handle the multi-output tuple, so both paths return tuples, and the signature reflects that. -- 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]
