zeroshade commented on code in PR #34631:
URL: https://github.com/apache/arrow/pull/34631#discussion_r1157646627
##########
go/arrow/table.go:
##########
@@ -69,7 +69,7 @@ type Column struct {
// of the ref counting.
func NewColumnFromArr(field Field, arr Array) Column {
if !TypeEqual(field.Type, arr.DataType()) {
- panic("arrow/array: inconsistent data type")
+ panic(fmt.Sprintf("arrow/array: inconsistent data type %s vs
%s", field.Type.String(), arr.DataType().String()))
Review Comment:
I can agree that adding more information in the errors is good. It might
make sense to use:
`fmt.Errorf("%w: arrow/array: inconsistent data type %s vs %s",
arrow.ErrInvalid, field.Type, arr.DataType)` instead of the `fmt.Sprintf`. You
also don't need to call `.String()` manually, since you're using `%s` it'll use
the `.String()` method automatically when printing it. So the code can look
cleaner.
--
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]