GH-48463: [Python] Improve error message in CheckTypeExact arrow_to_pandas.cc#48464
Merged
rok merged 1 commit intoapache:mainfrom Dec 19, 2025
Merged
GH-48463: [Python] Improve error message in CheckTypeExact arrow_to_pandas.cc#48464rok merged 1 commit intoapache:mainfrom
rok merged 1 commit intoapache:mainfrom
Conversation
|
|
Member
Author
|
@rok @icexelloss @AlenkaF could this be merged by any chance? 🙏 |
rok
approved these changes
Dec 19, 2025
Member
rok
left a comment
There was a problem hiding this comment.
Looks good. Thanks for working on this @HyukjinKwon !
Jonahkel
pushed a commit
to Jonahkel/arrow
that referenced
this pull request
Dec 22, 2025
…w_to_pandas.cc (apache#48464) ### Rationale for this change apache@3b000b7 first introduced this todo as below https://github.com/apache/arrow/blob/0bfbd19bce3e10163537b349f9205b635c87eea7/python/pyarrow/src/arrow/python/arrow_to_pandas.cc#L1130 Then, the error messages are actually handled at the higher level if I am not mistaken (e.g., 05bc63c introduced `_sanitize_arrays` and casting at `asarray` ). So the end users would not reach this. This is more for a sanity check and developers to debug. This is to improve the error message for the sanity check and developers. ### What changes are included in this PR? This PR improves the error message in CheckTypeExact arrow_to_pandas.cc by adding the corresponding NumPy string type. ### Are these changes tested? Unittest is added, and manually run as below: ``` pytest pyarrow/tests/test_cpp_internals.py::test_get_numpy_type_name -v ``` ### Are there any user-facing changes? No. * GitHub Issue: apache#48463 Authored-by: Hyukjin Kwon <gurwls223@apache.org> Signed-off-by: Rok Mihevc <rok@mihevc.org>
|
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 6a481e5. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them. |
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
3b000b7 first introduced this todo as below
arrow/python/pyarrow/src/arrow/python/arrow_to_pandas.cc
Line 1130 in 0bfbd19
Then, the error messages are actually handled at the higher level if I am not mistaken (e.g., 05bc63c introduced
_sanitize_arraysand casting atasarray). So the end users would not reach this. This is more for a sanity check and developers to debug.This is to improve the error message for the sanity check and developers.
What changes are included in this PR?
This PR improves the error message in CheckTypeExact arrow_to_pandas.cc by adding the corresponding NumPy string type.
Are these changes tested?
Unittest is added, and manually run as below:
Are there any user-facing changes?
No.