alamb opened a new pull request, #10838: URL: https://github.com/apache/arrow-rs/pull/10838
# Which issue does this PR close? - Part of #7595. # Rationale for this change The invariants governing `ArrayData::offset` — that it applies to `buffers` and `child_data` (composing cumulatively with any offset a child itself has) but NOT to `nulls` — are currently documented only on the **private fields** of `ArrayData`, so they never appear in rendered rustdoc. This makes it hard to reason about what a correct fix looks like when offset-handling bugs come up (e.g. #7595 / #7750 and the review of #10835, where the correct output representation of `ArrayData::slice` for structs hinges on exactly this contract). This PR surfaces those invariants on the public accessors so they are visible in the docs and can be cited as the authority in code and reviews. # What changes are included in this PR? Documentation only, in `arrow-data/src/data.rs`: - `ArrayData::offset()`: states where the offset applies (buffers and child data, never nulls) and spells out the struct case: logical element `i` of the struct corresponds to element `offset + i` of each child, composing cumulatively with the child's own offset. - `ArrayData::child_data()`: notes that for element-aligned children (such as structs) the parent's `offset`/`len` window the children, and points back to `Self::offset`. # Are these changes tested? Docs only; covered by CI doc builds. # Are there any user-facing changes? Documentation only — no behavior changes. -- 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]
