[ https://issues.apache.org/jira/browse/ARROW-1998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16361026#comment-16361026 ]
Antoine Pitrou commented on ARROW-1998: --------------------------------------- gdb backtrace: {code} #0 0x00007f8b5bdde428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54 #1 0x00007f8b5bde002a in __GI_abort () at abort.c:89 #2 0x00007f8b5760bc2a in arrow::internal::CerrLog::~CerrLog (this=0x7ffe01e57dc0, __in_chrg=<optimized out>) at /home/antoine/arrow/cpp/src/arrow/util/logging.h:108 #3 0x00007f8b572089bd in arrow::py::NdarrayToArrow (pool=0x7f8b57c92680 <arrow::default_memory_pool()::default_memory_pool_>, ao=0x7f8b5d2dcd00, mo=0x7f8b5d168e90 <_Py_NoneStruct>, use_pandas_null_sentinels=true, type=..., out=0x7ffe01e580c0) at /home/antoine/arrow/cpp/src/arrow/python/numpy_to_arrow.cc:1574 #4 0x00007f8b57d62b8a in __pyx_f_7pyarrow_3lib__ndarray_to_array (__pyx_v_values=0x7f8b5d2dcd00, __pyx_v_mask=0x7f8b5d168e90 <_Py_NoneStruct>, __pyx_v_type=0x7f8b44bde330, __pyx_v_use_pandas_null_sentinels=true, __pyx_v_pool=0x7f8b57c92680 <arrow::default_memory_pool()::default_memory_pool_>) at /home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx:32263 #5 0x00007f8b57d65b46 in __pyx_pf_7pyarrow_3lib_70array (__pyx_self=0x0, __pyx_v_obj=0x7f8b5d2dcd00, __pyx_v_type=0x7f8b44bde330, __pyx_v_mask=0x7f8b5d168e90 <_Py_NoneStruct>, __pyx_v_memory_pool=0x7f8b5d168e90 <_Py_NoneStruct>, __pyx_v_size=0x7f8b5d168e90 <_Py_NoneStruct>, __pyx_v_from_pandas=0x7f8b5d14f7a0 <_Py_TrueStruct>) at /home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx:33040 #6 0x00007f8b57d6401a in __pyx_pw_7pyarrow_3lib_71array (__pyx_self=0x0, __pyx_args=0x7f8b5d2f1a20, __pyx_kwds=0x7f8b5d300798) at /home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx:32664 [...] {code} > [Python] Table.from_pandas crashes when data frame is empty > ----------------------------------------------------------- > > Key: ARROW-1998 > URL: https://issues.apache.org/jira/browse/ARROW-1998 > Project: Apache Arrow > Issue Type: Bug > Components: Python > Affects Versions: 0.8.0 > Environment: Windows 10 Build 15063.850 > Python: 3.6.3 > Numpy: 1.14.0 > Pandas: 0.22.0 > Reporter: Victor Jimenez > Assignee: Phillip Cloud > Priority: Major > Fix For: 0.9.0 > > > Loading an empty CSV file, and then attempting to create a PyArrow Table from > it makes the application crash. The following code should be able to > reproduce the issue: > {code} > import numpy as np > import pandas as pd > import pyarrow as pa > FIELDS = ['id', 'name'] > NUMPY_TYPES = { > 'id': np.int64, > 'name': np.unicode > } > PYARROW_SCHEMA = pa.schema([ > pa.field('id', pa.int64()), > pa.field('name', pa.string()) > ]) > file = open('input.csv', 'w') > file.close() > df = pd.read_csv( > 'input.csv', > header=None, > names=FIELDS, > dtype=NUMPY_TYPES, > engine='c', > ) > pa.Table.from_pandas(df, schema=PYARROW_SCHEMA) > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)