xinrong-meng opened a new pull request, #41485:
URL: https://github.com/apache/spark/pull/41485

   ### What changes were proposed in this pull request?
   Use pandas ExtensionDtype for integral Series with Nulls after Arrow to 
Pandas conversion.
   
   
   ### Why are the changes needed?
   More reasonable results after Arrow to Pandas conversion.
   
   
   ### Does this PR introduce _any_ user-facing change?
   No behavior changes, only the `na` in the string representation becomes 
`<NA>`.
   
   ```py
   df = spark.createDataFrame([1, None], schema='int')
   
   # FROM
   >>> df.select(pandas_udf(lambda x: x.astype(str), 'string')('value')).show()
   +---------------+                                                            
   
   |<lambda>(value)|
   +---------------+
   |              1|
   |            nan|
   +---------------+
   
   # TO
   >>> df.select(pandas_udf(lambda x: x.astype(str), 'string')('value')).show()
   +---------------+
   |<lambda>(value)|
   +---------------+
   |              1|
   |           <NA>|
   +---------------+
   ```
   
   ### How was this patch tested?
   Unit 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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to