pitrou commented on pull request #9738:
URL: https://github.com/apache/arrow/pull/9738#issuecomment-801062229


   This is a recurring problem, so instead of testing for None manually we 
could let Cython do it for us:
   ```diff
   diff --git a/python/pyarrow/lib.pyx b/python/pyarrow/lib.pyx
   index eba0f5a47..aa6918b54 100644
   --- a/python/pyarrow/lib.pyx
   +++ b/python/pyarrow/lib.pyx
   @@ -15,9 +15,10 @@
    # specific language governing permissions and limitations
    # under the License.
    
   -# cython: profile=False
   -# distutils: language = c++
   +# cython: profile = False
    # cython: embedsignature = True
   +# cython: nonecheck = True
   +# distutils: language = c++
    
    import datetime
    import decimal as _pydecimal
   diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi
   index 2d474ba76..3f1fc28ee 100644
   --- a/python/pyarrow/table.pxi
   +++ b/python/pyarrow/table.pxi
   @@ -2225,8 +2225,6 @@ def concat_tables(tables, c_bool promote=False, 
MemoryPool memory_pool=None):
                CConcatenateTablesOptions.Defaults())
    
        for table in tables:
   -        if table is None:
   -            raise TypeError("Unable to concatenate table. Table is None.")
            c_tables.push_back(table.sp_table)
    
        with nogil:
   ```
   
   Note that a few tests will need fixing.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to