Skip to content

GH-55410: [Docs][C++] Fix is_printable empty-string FunctionDoc - #55421

Open
ump45nose wants to merge 1 commit into
apache:mainfrom
ump45nose:fix/55410-printable-empty-docs
Open

ump45nose wants to merge 1 commit into
apache:mainfrom
ump45nose:fix/55410-printable-empty-docs

Conversation

@ump45nose

@ump45nose ump45nose commented Nov 5, 2026 •

Copy link
Copy Markdown

Rationale for this change

Fixes #55410.

utf8_is_printable / ascii_is_printable use allow_empty=true, so an empty string returns true (same as Python str.isprintable()). Their StringClassifyDoc(..., non_empty=true) wording incorrectly said the string must be non-empty.

What changes are included in this PR?

Pass non_empty=false for both printable FunctionDocs so the generated description matches the kernels:

  • before: "emit true iff the string is non-empty and consists only of …printable…"
  • after: "emit true iff the string consists only of …printable…" (empty is vacuously true)

Are these changes tested?

Docs-only. Existing Python tests already assert utf8_is_printable matches str.isprintable() (including empty). I did not rebuild Arrow C++ in this environment; the change is limited to two StringClassifyDoc boolean arguments.

Are there any user-facing changes?

Docs / FunctionDoc text only (pyarrow docstring text derived from these FunctionDocs).

AI assistance

Assisted by an AI coding tool for locating the StringClassifyDoc call sites and drafting this PR text. I reviewed the kernel allow_empty flags against Python str.isprintable() and confirmed the two-line docs fix matches issue #55410.

utf8_is_printable and ascii_is_printable allow empty strings (matching
Python str.isprintable()), but StringClassifyDoc was called with
non_empty=true, which documented the opposite. Pass false so the docs
match the kernels.
Copilot AI balanced review requested due to automatic review settings November 5, 2026 19:39
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the documentation update aligning printable-predicate docstrings with their existing empty-string behavior.

No open issues 🎉

What changed in this PR

Updates the C++ FunctionDocs for utf8_is_printable and ascii_is_printable to match their existing empty-string behavior, addressing the generated-docstring mismatch reported in #55410.

Changes:

  • Sets non_empty=false for both printable predicates, removing the incorrect non-empty requirement.
  • Updates derived PyArrow docstring text without changing kernel behavior.
File Description
cpp/​src/​arrow/​compute/​kernels/​scalar_string_utf8.cc Corrects the Unicode printable predicate’s FunctionDoc.
cpp/​src/​arrow/​compute/​kernels/​scalar_string_ascii.cc Corrects the ASCII printable predicate’s FunctionDoc.

Review effort: Balanced

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Docs][C++][Python] utf8_is_printable and ascii_is_printable docs say an empty string is false, the kernels return true

2 participants