Copilot commented on code in PR #50327:
URL: https://github.com/apache/arrow/pull/50327#discussion_r3546201025


##########
python/pyarrow/lib.pxd:
##########
@@ -282,6 +282,8 @@ cdef class Array(_PandasConvertible):
     cdef:
         shared_ptr[CArray] sp_array
         CArray* ap
+        # Lazily wrapped child array(s) reused by _getitem_py (see GH-50326)
+        object _children_cache

Review Comment:
   Adding `_children_cache` inside the first `cdef:` block changes the memory 
layout of `Array` *before* existing fields like `type`/`_name`. That can break 
ABI for downstream Cython extensions that were compiled against an older 
`pyarrow/lib.pxd` but run against this version (their compiled field offsets no 
longer match). To reduce ABI risk, keep existing field offsets stable by moving 
`_children_cache` to the end of the class layout (e.g., in a second `cdef:` 
block after the `cdef readonly:` fields).



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to