From 6b75e94c8cfe79afc8a24a0a1d320e6f04320610 Mon Sep 17 00:00:00 2001 From: MarkCruz911 <85602094+MarkCruz911@users.noreply.github.com> Date: Thu, 22 Oct 2026 06:20:23 +0000 Subject: [PATCH] GH-49717: [Python] Document validation requirements for array buffer constructors --- python/pyarrow/array.pxi | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/python/pyarrow/array.pxi b/python/pyarrow/array.pxi index bf9a6d67228..69b24c0b167 100644 --- a/python/pyarrow/array.pxi +++ b/python/pyarrow/array.pxi @@ -1354,6 +1354,14 @@ cdef class Array(_PandasConvertible): The concrete type returned depends on the datatype. + .. warning:: + + The caller is responsible for providing valid Arrow data. + Only basic validation checks are performed when constructing + the array. Call ``validate(full=True)`` on the resulting array + before using it to perform thorough validation checks. + Using an array with invalid data may lead to crashes. + Parameters ---------- type : DataType @@ -4211,6 +4219,14 @@ cdef class StringArray(Array): If there are nulls in the data, also a null_bitmap and the matching null_count must be passed. + .. warning:: + + The caller is responsible for providing valid Arrow data. + Only basic validation checks are performed when constructing + the array. Call ``validate(full=True)`` on the resulting array + before using it to perform thorough validation checks. + Using an array with invalid data may lead to crashes. + Parameters ---------- length : int @@ -4249,6 +4265,14 @@ cdef class LargeStringArray(Array): If there are nulls in the data, also a null_bitmap and the matching null_count must be passed. + .. warning:: + + The caller is responsible for providing valid Arrow data. + Only basic validation checks are performed when constructing + the array. Call ``validate(full=True)`` on the resulting array + before using it to perform thorough validation checks. + Using an array with invalid data may lead to crashes. + Parameters ---------- length : int @@ -4369,6 +4393,14 @@ cdef class DictionaryArray(Array): """ Construct a DictionaryArray from buffers. + .. warning:: + + The caller is responsible for providing valid Arrow data. + Only basic validation checks are performed when constructing + the array. Call ``validate(full=True)`` on the resulting array + before using it to perform thorough validation checks. + Using an array with invalid data may lead to crashes. + Parameters ---------- type : pyarrow.DataType