You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "jorisvandenbossche (via GitHub)" <gi...@apache.org> on 2023/05/24 08:49:42 UTC

[GitHub] [arrow] jorisvandenbossche commented on issue #35717: [Python] pa.array([Decimal("nan")]) raises

jorisvandenbossche commented on issue #35717:
URL: https://github.com/apache/arrow/issues/35717#issuecomment-1560707158

   Yes, for a generic sequence of python objects, we currently just check if an object is "null" or not using:
   
   https://github.com/apache/arrow/blob/53c0d338e6e45cb28a3c1973522da1257eaea761/python/pyarrow/src/arrow/python/helpers.cc#L359-L372
   
   but once we determined an object to be null, we don't take the actual type of object into account for the type inference.
   
   So that also means that currently you could mix all kinds of null-likes together when specifying `from_pandas=True` (also for cases where pandas would not allow this), for example:
   
   ```
   In [18]: pa.array([1, pd.NaT], from_pandas=True)
   Out[18]: 
   <pyarrow.lib.Int64Array object at 0x7fcb37d62ec0>
   [
     1,
     null
   ]
   ```


-- 
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: github-unsubscribe@arrow.apache.org

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