jorisvandenbossche commented on issue #40815: URL: https://github.com/apache/arrow/issues/40815#issuecomment-2364173522
Indeed, this is expected. At the moment, pandas uses numpy integer dtypes by default, and those can't contain any missing values. Thus, when there are missing values we convert to float64 instead. The current workarounds possible are the ones you already mentioned in the top-post, i.e. ensure you use the (opt-in) nullable Int8 dtype in pandas. This can be done from the pandas side using the `dtype_backend` keyword (as shown in the top post). If you want to achieve this from pyarrow through a `Table.to_pandas()` call, you can specify `types_mapper` keyword as documented in https://arrow.apache.org/docs/dev/python/pandas.html#nullable-types -- 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]
