Skip to content

GH-49717: [Python] Document validation requirements for array buffer … - #54922

Open
MarkCruz911 wants to merge 1 commit into
apache:mainfrom
MarkCruz911:docs-49717-from-buffers-safety
Open

MarkCruz911 wants to merge 1 commit into
apache:mainfrom
MarkCruz911:docs-49717-from-buffers-safety

Conversation

@MarkCruz911

@MarkCruz911 MarkCruz911 commented Oct 22, 2026 •

Copy link
Copy Markdown

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:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

@github-actions

Copy link
Copy Markdown

⚠️ GitHub issue #49717 has been automatically assigned in GitHub to PR creator.

@MarkCruz911

Copy link
Copy Markdown
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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] Array.from_buffers docs should mention safety issues

1 participant