You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/06/23 08:59:00 UTC

[jira] [Updated] (ARROW-4885) [Python] read_csv() can't handle decimal128 columns

     [ https://issues.apache.org/jira/browse/ARROW-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ASF GitHub Bot updated ARROW-4885:
----------------------------------
    Labels: csv pull-request-available  (was: csv)

> [Python] read_csv() can't handle decimal128 columns
> ---------------------------------------------------
>
>                 Key: ARROW-4885
>                 URL: https://issues.apache.org/jira/browse/ARROW-4885
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Python
>    Affects Versions: 0.12.1
>         Environment: Python: 3.7.2, 2.7.15
> PyArrow: 0.12.1
> OS: MacOS 10.13.4 (High Sierra)
>            Reporter: Diego Argueta
>            Assignee: Micah Kornfield
>            Priority: Major
>              Labels: csv, pull-request-available
>
> h1. Summary
> {\{read_csv()}} crashes when given a {{decimal128}} column type in its convert options. The cause is that there's no converter listed [here|https://github.com/apache/arrow/blob/master/cpp/src/arrow/csv/converter.cc#L301-L315].
> h1. To Reproduce
> 1) First, create a CSV file like so and save it somewhere:
> {code:java}
> Header
> 123.45
> {code}
> 2) Run the following code on Python 2 or 3:
> {code:java}
> import pyarrow.csv as pa_csv
> import pyarrow as pa
> import io
> types = {'Header': pa.decimal128(11, 2)}
> convert_options = pa_csv.ConvertOptions(column_types=types)
> pa_csv.read_csv('/home/dargueta/Desktop/test.csv', convert_options=convert_options)
> {code}
> read_csv() crashes with the following exception:
> {code:java}
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "pyarrow/_csv.pyx", line 397, in pyarrow._csv.read_csv
>   File "pyarrow/error.pxi", line 89, in pyarrow.lib.check_status
> pyarrow.lib.ArrowNotImplementedError: CSV conversion to decimal(11, 2) is not supported
> CSV conversion to decimal(11, 2) is not supported
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)