@@ -28,7 +28,7 @@ import (
2828 "github.com/apache/arrow/go/arrow/array"
2929 "github.com/apache/arrow/go/arrow/float16"
3030 "github.com/apache/arrow/go/arrow/memory"
31- "github.com/pkg/errors "
31+ "golang.org/x/xerrors "
3232)
3333
3434const (
@@ -152,7 +152,7 @@ func dtypeToJSON(dt arrow.DataType) dataType {
152152 ByteWidth : dt .ByteWidth ,
153153 }
154154 }
155- panic (errors .Errorf ("unknown arrow.DataType %v" , dt ))
155+ panic (xerrors .Errorf ("unknown arrow.DataType %v" , dt ))
156156}
157157
158158func dtypeFromJSON (dt dataType , children []Field ) arrow.DataType {
@@ -261,7 +261,7 @@ func dtypeFromJSON(dt dataType, children []Field) arrow.DataType {
261261 return arrow .FixedWidthTypes .Duration_ns
262262 }
263263 }
264- panic (errors .Errorf ("unknown DataType %#v" , dt ))
264+ panic (xerrors .Errorf ("unknown DataType %#v" , dt ))
265265}
266266
267267func schemaToJSON (schema * arrow.Schema ) Schema {
@@ -541,7 +541,7 @@ func arrayFromJSON(mem memory.Allocator, dt arrow.DataType, arr Array) array.Int
541541 data := make ([][]byte , len (strdata ))
542542 for i , v := range strdata {
543543 if len (v ) != 2 * dt .ByteWidth {
544- panic (errors .Errorf ("arrjson: invalid hex-string length (got=%d, want=%d)" , len (v ), 2 * dt .ByteWidth ))
544+ panic (xerrors .Errorf ("arrjson: invalid hex-string length (got=%d, want=%d)" , len (v ), 2 * dt .ByteWidth ))
545545 }
546546 vv , err := hex .DecodeString (v )
547547 if err != nil {
@@ -618,7 +618,7 @@ func arrayFromJSON(mem memory.Allocator, dt arrow.DataType, arr Array) array.Int
618618 return bldr .NewArray ()
619619
620620 default :
621- panic (errors .Errorf ("unknown data type %v %T" , dt , dt ))
621+ panic (xerrors .Errorf ("unknown data type %v %T" , dt , dt ))
622622 }
623623 panic ("impossible" )
624624}
@@ -791,7 +791,7 @@ func arrayToJSON(field arrow.Field, arr array.Interface) Array {
791791 for i := range o .Data {
792792 v := []byte (strings .ToUpper (hex .EncodeToString (arr .Value (i ))))
793793 if len (v ) != 2 * dt .ByteWidth {
794- panic (errors .Errorf ("arrjson: invalid hex-string length (got=%d, want=%d)" , len (v ), 2 * dt .ByteWidth ))
794+ panic (xerrors .Errorf ("arrjson: invalid hex-string length (got=%d, want=%d)" , len (v ), 2 * dt .ByteWidth ))
795795 }
796796 o .Data [i ] = string (v ) // re-convert as string to prevent json.Marshal from base64-encoding it.
797797 }
@@ -859,7 +859,7 @@ func arrayToJSON(field arrow.Field, arr array.Interface) Array {
859859 }
860860
861861 default :
862- panic (errors .Errorf ("unknown array type %T" , arr ))
862+ panic (xerrors .Errorf ("unknown array type %T" , arr ))
863863 }
864864 panic ("impossible" )
865865}
@@ -1129,7 +1129,7 @@ func strFromJSON(vs []interface{}) []string {
11291129 case json.Number :
11301130 o [i ] = v .String ()
11311131 default :
1132- panic (errors .Errorf ("could not convert %v (%T) to a string" , v , v ))
1132+ panic (xerrors .Errorf ("could not convert %v (%T) to a string" , v , v ))
11331133 }
11341134 }
11351135 return o
@@ -1153,10 +1153,10 @@ func bytesFromJSON(vs []interface{}) [][]byte {
11531153 case json.Number :
11541154 o [i ], err = hex .DecodeString (v .String ())
11551155 default :
1156- panic (errors .Errorf ("could not convert %v (%T) to a string" , v , v ))
1156+ panic (xerrors .Errorf ("could not convert %v (%T) to a string" , v , v ))
11571157 }
11581158 if err != nil {
1159- panic (errors .Errorf ("could not decode %v: %v" , v , err ))
1159+ panic (xerrors .Errorf ("could not decode %v: %v" , v , err ))
11601160 }
11611161 }
11621162 return o
@@ -1340,7 +1340,7 @@ func buildArray(bldr array.Builder, data array.Interface) {
13401340
13411341 switch bldr := bldr .(type ) {
13421342 default :
1343- panic (errors .Errorf ("unknown builder %T" , bldr ))
1343+ panic (xerrors .Errorf ("unknown builder %T" , bldr ))
13441344
13451345 case * array.BooleanBuilder :
13461346 data := data .(* array.Boolean )
0 commit comments