Antoine Pitrou created ARROW-2347:
-------------------------------------

             Summary: [Python] Multiple warnings with -Wconversion
                 Key: ARROW-2347
                 URL: https://issues.apache.org/jira/browse/ARROW-2347
             Project: Apache Arrow
          Issue Type: Bug
            Reporter: Antoine Pitrou


There are multiple warnings when compiling the Cython-generated code with 
{{-Wconversion}}:

 {code}
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx: In function 
'PyObject* __pyx_pf_7pyarrow_3lib_62union(PyObject*, PyObject*, PyObject*)':
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx:23850:45: 
warning: conversion to 'std::vector<unsigned char>::value_type {aka unsigned 
char}' from 'int' may alter its value [-Wconversion]
       __pyx_v_type_codes.push_back(__pyx_v_i);
                                             ^
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx: In function 
'PyObject* 
__Pyx_PyInt_From_enum____arrow_3a__3a_Type_3a__3a_type(arrow::Type::type)':
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx:125758:70: 
warning: the result of the conversion is unspecified because '-1' is outside 
the range of type 'arrow::Type::type' [-Wconversion]
     const enum  arrow::Type::type neg_one = (enum  arrow::Type::type) -1, 
const_zero = (enum  arrow::Type::type) 0;
                                                                      ^
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx: In function 
'PyObject* 
__Pyx_PyInt_From_enum____arrow_3a__3a_UnionMode_3a__3a_type(arrow::UnionMode::type)':
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx:125789:80: 
warning: the result of the conversion is unspecified because '-1' is outside 
the range of type 'arrow::UnionMode::type' [-Wconversion]
     const enum  arrow::UnionMode::type neg_one = (enum  
arrow::UnionMode::type) -1, const_zero = (enum  arrow::UnionMode::type) 0;
                                                                                
^
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx: In function 
'PyObject* 
__Pyx_PyInt_From_enum____arrow_3a__3a_TimeUnit_3a__3a_type(arrow::TimeUnit::type)':
/home/antoine/arrow/python/build/temp.linux-x86_64-3.6/lib.cxx:125820:78: 
warning: the result of the conversion is unspecified because '-1' is outside 
the range of type 'arrow::TimeUnit::type' [-Wconversion]
     const enum  arrow::TimeUnit::type neg_one = (enum  arrow::TimeUnit::type) 
-1, const_zero = (enum  arrow::TimeUnit::type) 0;
                                                                              ^
{code}

(also similar warnings for _parquet.pyx due to Parquet enumerations)



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

Reply via email to