ueshin opened a new pull request #33547:
URL: https://github.com/apache/spark/pull/33547


   ### What changes were proposed in this pull request?
   
   Fix `IndexOpsMixin.hasnans` to use `IndexOpsMixin.isnull().any()`.
   
   ### Why are the changes needed?
   
   `IndexOpsMixin.hasnans` has a potential issue to cause `a window function 
inside an aggregate function` error.
   Also it returns a wrong value when the `Series`/`Index` is empty.
   
   ```py
   >>> ps.Series([]).hasnans
   None
   ```
   
   whereas:
   
   ```py
   >>> pd.Series([]).hasnans
   False
   ```
   
   `IndexOpsMixin.any()` is safe for both cases.
   
   ### Does this PR introduce _any_ user-facing change?
   
   `IndexOpsMixin.hasnans` will return `False` when empty.
   
   ### How was this patch tested?
   
   Added some tests.
   


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

Reply via email to