Commit 6a481e5
authored
### Rationale for this change
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: #48463
Authored-by: Hyukjin Kwon <[email protected]>
Signed-off-by: Rok Mihevc <[email protected]>
1 parent 71d4931 commit 6a481e5
File tree
2 files changed
+20
-2
lines changed- python/pyarrow/src/arrow/python
2 files changed
+20
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
1130 | | - | |
1131 | | - | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
1132 | 1133 | | |
1133 | 1134 | | |
1134 | 1135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
847 | 848 | | |
848 | 849 | | |
849 | 850 | | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
850 | 866 | | |
851 | 867 | | |
852 | 868 | | |
| |||
886 | 902 | | |
887 | 903 | | |
888 | 904 | | |
| 905 | + | |
889 | 906 | | |
890 | 907 | | |
891 | 908 | | |
| |||
0 commit comments