jorisvandenbossche commented on code in PR #51157:
URL: https://github.com/apache/arrow/pull/51157#discussion_r4143193181
##########
python/pyarrow/src/arrow/python/numpy_to_arrow.cc:
##########
@@ -342,6 +346,11 @@ Status NumPyConverter::Convert() {
return Status::Invalid("Must pass data type for non-object arrays");
}
+ if (dtype_->type_num == NPY_VSTRING &&
!is_string_or_string_view(type_->id())) {
+ return Status::TypeError("Expected an Arrow string type for NumPy
StringDType, got ",
+ type_->ToString());
Review Comment:
Is this needed? (we don't seem to have it here for other types)
If you leave it out, we get a less good error message? (which feels as
something to improve in general, so fine to leave this here as is, and consider
cleaning this up / generalizing this as another issue)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]