You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by sb...@apache.org on 2020/04/02 07:59:07 UTC

[arrow] branch master updated: ARROW-5585: [Go] Rename TypeEquals to TypeEqual

This is an automated email from the ASF dual-hosted git repository.

sbinet pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new d8243f8  ARROW-5585: [Go] Rename TypeEquals to TypeEqual
d8243f8 is described below

commit d8243f84cd515791e6cb5a14fa0945bb3d495102
Author: Palmer Lao <pa...@gmail.com>
AuthorDate: Thu Apr 2 09:58:26 2020 +0200

    ARROW-5585: [Go] Rename TypeEquals to TypeEqual
    
    via
    find . -type f -exec sed -i "s/TypeEquals/TypeEqual/g" {} \;
    
    Closes #6746 from palmerlao/arrow-5585
    
    Authored-by: Palmer Lao <pa...@gmail.com>
    Signed-off-by: Sebastien Binet <bi...@cern.ch>
---
 go/arrow/array/compare.go |  2 +-
 go/arrow/array/record.go  |  2 +-
 go/arrow/array/table.go   |  4 ++--
 go/arrow/compare.go       | 14 +++++++-------
 go/arrow/compare_test.go  |  8 ++++----
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/go/arrow/array/compare.go b/go/arrow/array/compare.go
index 61c02dc..537630d 100644
--- a/go/arrow/array/compare.go
+++ b/go/arrow/array/compare.go
@@ -367,7 +367,7 @@ func baseArrayEqual(left, right Interface) bool {
 		return false
 	case left.NullN() != right.NullN():
 		return false
-	case !arrow.TypeEquals(left.DataType(), right.DataType()): // We do not check for metadata as in the C++ implementation.
+	case !arrow.TypeEqual(left.DataType(), right.DataType()): // We do not check for metadata as in the C++ implementation.
 		return false
 	case !validityBitmapEqual(left, right):
 		return false
diff --git a/go/arrow/array/record.go b/go/arrow/array/record.go
index f7b7bd7..ab7961d 100644
--- a/go/arrow/array/record.go
+++ b/go/arrow/array/record.go
@@ -187,7 +187,7 @@ func (rec *simpleRecord) validate() error {
 				arr.Len(), rec.rows,
 			)
 		}
-		if !arrow.TypeEquals(f.Type, arr.DataType()) {
+		if !arrow.TypeEqual(f.Type, arr.DataType()) {
 			return fmt.Errorf("arrow/array: column %q type mismatch: got=%v, want=%v",
 				f.Name,
 				arr.DataType(), f.Type,
diff --git a/go/arrow/array/table.go b/go/arrow/array/table.go
index 4d8bb45..ded6d11 100644
--- a/go/arrow/array/table.go
+++ b/go/arrow/array/table.go
@@ -55,7 +55,7 @@ func NewColumn(field arrow.Field, chunks *Chunked) *Column {
 	}
 	col.data.Retain()
 
-	if !arrow.TypeEquals(col.data.DataType(), col.field.Type) {
+	if !arrow.TypeEqual(col.data.DataType(), col.field.Type) {
 		col.data.Release()
 		panic("arrow/array: inconsistent data type")
 	}
@@ -117,7 +117,7 @@ func NewChunked(dtype arrow.DataType, chunks []Interface) *Chunked {
 		dtype:    dtype,
 	}
 	for i, chunk := range chunks {
-		if !arrow.TypeEquals(chunk.DataType(), dtype) {
+		if !arrow.TypeEqual(chunk.DataType(), dtype) {
 			panic("arrow/array: mismatch data type")
 		}
 		chunk.Retain()
diff --git a/go/arrow/compare.go b/go/arrow/compare.go
index 17bbd63..c2ca4e3 100644
--- a/go/arrow/compare.go
+++ b/go/arrow/compare.go
@@ -24,21 +24,21 @@ type typeEqualsConfig struct {
 	metadata bool
 }
 
-// TypeEqualsOption is a functional option type used for configuring type
+// TypeEqualOption is a functional option type used for configuring type
 // equality checks.
-type TypeEqualsOption func(*typeEqualsConfig)
+type TypeEqualOption func(*typeEqualsConfig)
 
-// CheckMetadata is an option for TypeEquals that allows checking for metadata
+// CheckMetadata is an option for TypeEqual that allows checking for metadata
 // equality besides type equality. It only makes sense for STRUCT type.
-func CheckMetadata() TypeEqualsOption {
+func CheckMetadata() TypeEqualOption {
 	return func(cfg *typeEqualsConfig) {
 		cfg.metadata = true
 	}
 }
 
-// TypeEquals checks if two DataType are the same, optionally checking metadata
+// TypeEqual checks if two DataType are the same, optionally checking metadata
 // equality for STRUCT types.
-func TypeEquals(left, right DataType, opts ...TypeEqualsOption) bool {
+func TypeEqual(left, right DataType, opts ...TypeEqualOption) bool {
 	var cfg typeEqualsConfig
 	for _, opt := range opts {
 		opt(&cfg)
@@ -71,7 +71,7 @@ func TypeEquals(left, right DataType, opts ...TypeEqualsOption) bool {
 			return false
 		case leftField.Nullable != rightField.Nullable:
 			return false
-		case !TypeEquals(leftField.Type, rightField.Type, opts...):
+		case !TypeEqual(leftField.Type, rightField.Type, opts...):
 			return false
 		}
 	}
diff --git a/go/arrow/compare_test.go b/go/arrow/compare_test.go
index 16c4daf..47e1bb7 100644
--- a/go/arrow/compare_test.go
+++ b/go/arrow/compare_test.go
@@ -20,7 +20,7 @@ import (
 	"testing"
 )
 
-func TestTypeEquals(t *testing.T) {
+func TestTypeEqual(t *testing.T) {
 	tests := []struct {
 		left, right   DataType
 		want          bool
@@ -240,12 +240,12 @@ func TestTypeEquals(t *testing.T) {
 		t.Run("", func(t *testing.T) {
 			var got bool
 			if test.checkMetadata {
-				got = TypeEquals(test.left, test.right, CheckMetadata())
+				got = TypeEqual(test.left, test.right, CheckMetadata())
 			} else {
-				got = TypeEquals(test.left, test.right)
+				got = TypeEqual(test.left, test.right)
 			}
 			if got != test.want {
-				t.Fatalf("TypeEquals(%v, %v, %v): got=%v, want=%v", test.left, test.right, test.checkMetadata, got, test.want)
+				t.Fatalf("TypeEqual(%v, %v, %v): got=%v, want=%v", test.left, test.right, test.checkMetadata, got, test.want)
 			}
 		})
 	}