Repository navigation
Conversation
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.
|
|
Contributor
There was a problem hiding this comment.
🟢 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=falsefor 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
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
Fixes #55410.
utf8_is_printable/ascii_is_printableuseallow_empty=true, so an empty string returns true (same as Pythonstr.isprintable()). TheirStringClassifyDoc(..., non_empty=true)wording incorrectly said the string must be non-empty.What changes are included in this PR?
Pass
non_empty=falsefor both printable FunctionDocs so the generated description matches the kernels:Are these changes tested?
Docs-only. Existing Python tests already assert
utf8_is_printablematchesstr.isprintable()(including empty). I did not rebuild Arrow C++ in this environment; the change is limited to twoStringClassifyDocboolean 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
StringClassifyDoccall sites and drafting this PR text. I reviewed the kernelallow_emptyflags against Pythonstr.isprintable()and confirmed the two-line docs fix matches issue #55410.