From bda7f4ce61fc0594f6a06883cd902b0375868e77 Mon Sep 17 00:00:00 2001 From: Licht-T Date: Tue, 24 Oct 2017 23:44:24 +0900 Subject: [PATCH] BUG: Implement bounds check in chunk getter --- python/pyarrow/table.pxi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python/pyarrow/table.pxi b/python/pyarrow/table.pxi index dd42cf231e7e2..694fe919044c1 100644 --- a/python/pyarrow/table.pxi +++ b/python/pyarrow/table.pxi @@ -102,6 +102,10 @@ cdef class ChunkedArray: pyarrow.Array """ self._check_nullptr() + + if i >= self.num_chunks or i < 0: + raise IndexError('Chunk index out of range.') + return pyarrow_wrap_array(self.chunked_array.chunk(i)) def iterchunks(self):