Antony Mayi created ARROW-2145:

             Summary: decimal conversion not working for NaN values
                 Key: ARROW-2145
             Project: Apache Arrow
          Issue Type: Bug
          Components: C++, Python
    Affects Versions: 0.8.0
            Reporter: Antony Mayi

import pyarrow as pa
import pandas as pd
import decimal

pa.Table.from_pandas(pd.DataFrame({'a': [decimal.Decimal('1.1'), 

throws following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyarrow/table.pxi", line 875, in pyarrow.lib.Table.from_pandas 
  File "/lib/python3.6/site-packages/pyarrow/", line 350, in 
  File "/lib/python3.6/site-packages/pyarrow/", line 349, in 
    for c, t in zip(columns_to_convert,
  File "/lib/python3.6/site-packages/pyarrow/", line 345, in 
    return pa.array(col, from_pandas=True, type=ty)
  File "pyarrow/array.pxi", line 170, in pyarrow.lib.array 
  File "pyarrow/array.pxi", line 70, in pyarrow.lib._ndarray_to_array 
  File "pyarrow/error.pxi", line 98, in pyarrow.lib.check_status 
pyarrow.lib.ArrowException: Unknown error: an integer is required (got type str)

Same problem with other special decimal values like {{infinity}}.

This message was sent by Atlassian JIRA

Reply via email to