zhengruifeng opened a new pull request, #44422:
URL: https://github.com/apache/spark/pull/44422

   ### What changes were proposed in this pull request?
   add `Column.isNaN` in pyspark
   
   ### Why are the changes needed?
   `Column.isNaN` was added in scala since 1.5.0, but it is still missing in 
python
   this pr adds it for parity
   
   
   ### Does this PR introduce _any_ user-facing change?
   yes
   
   ```
   In [1]: from pyspark.sql import Row
   
   In [2]: df = spark.createDataFrame([Row(name='Tom', height=80.0), 
Row(name='Alice', height=float('nan'))])
   
   In [3]: df.show()
   +-----+------+
   | name|height|
   +-----+------+
   |  Tom|  80.0|
   |Alice|   NaN|
   +-----+------+
   
   
   In [4]: df.filter(df.height.isNaN()).show()
   +-----+------+
   | name|height|
   +-----+------+
   |Alice|   NaN|
   +-----+------+
   ```
   
   
   ### How was this patch tested?
   added doctest
   
   
   ### Was this patch authored or co-authored using generative AI tooling?
   no


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