[ https://issues.apache.org/jira/browse/ARROW-4885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17661907#comment-17661907 ]
Rok Mihevc commented on ARROW-4885: ----------------------------------- This issue has been migrated to [issue #21395|https://github.com/apache/arrow/issues/21395] on GitHub. Please see the [migration documentation|https://github.com/apache/arrow/issues/14542] for further details. > [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: C++, 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 > Fix For: 0.14.0 > > Time Spent: 1.5h > Remaining Estimate: 0h > > 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 (v8.20.10#820010)