jorisvandenbossche commented on a change in pull request #12182: URL: https://github.com/apache/arrow/pull/12182#discussion_r787118442
########## File path: python/pyarrow/io.pxi ########## @@ -1056,10 +1056,10 @@ cdef class Buffer(_Weakrefable): raise IndexError('Offset must be non-negative') if length is None: - result = SliceBuffer(self.buffer, offset) + result = GetResultValue(SliceBufferSafe(self.buffer, offset)) else: - result = SliceBuffer(self.buffer, offset, max(length, 0)) - + result = GetResultValue(SliceBufferSafe(self.buffer, offset, + max(length, 0))) Review comment: Side question: should we rather raise an error for negative lengths? This `max(length, 0)` basically turns a negative length into an empty slice? -- 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. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org