Skip to content

Commit

Permalink
BUG: Implement bounds check in chunk getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Licht-T committed Oct 24, 2017
1 parent 4eb38a2 commit bda7f4c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/pyarrow/table.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit bda7f4c

Please sign in to comment.