Repository navigation
GH-49717: [Python] Document validation requirements for array buffer … - #54922
Open
MarkCruz911 wants to merge 1 commit into
Open
MarkCruz911 wants to merge 1 commit into
MarkCruz911 wants to merge 1 commit into
Conversation
…uffer constructors
|
|
Author
|
Hi @AlenkaF @raulcd @rok, I've opened this PR to address #49717. Could you please review it when you have a chance? I added documentation warnings to the four constructors that perform basic validation. I also checked RunEndEncodedArray.from_buffers and left it unchanged because it already performs full validation. I'm happy to make any adjustments. Thank you for your time! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
Closes #49717.
The from_buffers documentation should explain the caller's responsibility to provide valid Arrow data and the risk of crashes when using invalid arrays.
What changes are included in this PR?
Added warnings to the from_buffers docstrings for:
Array
StringArray
LargeStringArray
DictionaryArray
The warnings explain that construction performs basic validation and recommend calling validate(full=True) on the resulting array before using it.
RunEndEncodedArray.from_buffers was also reviewed. It delegates to _from_arrays, which already calls validate(full=True), so it was left unchanged.
Are these changes tested?
git diff --check passed.
Reviewed the diff to confirm that only the four docstrings were changed.
Inspected the constructor implementations and their validation calls.
The PyArrow test suite and documentation build have not been run.
Are there any user-facing changes?
The Python API documentation now explains validation responsibilities and the risk of crashes from invalid data. There are no changes to runtime behavior or public API signatures.
PR code and description written by:
Reviewed before submission by:
Array.from_buffersdocs should mention safety issues #49717