From 32e47642aeebb13804529d77e0320bc507d68aa9 Mon Sep 17 00:00:00 2001 From: Jaden Weiss Date: Wed, 10 Jun 2020 17:49:00 -0400 Subject: [PATCH] address review of "Apply base in GroupBy on BSI" --- executor.go | 5 +++-- executor_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/executor.go b/executor.go index 02991553b..f2dd49fcb 100644 --- a/executor.go +++ b/executor.go @@ -1799,10 +1799,11 @@ func (e *executor) executeGroupBy(ctx context.Context, index string, c *pql.Call if err != nil { return nil, errors.Wrap(err, "getting column") } - if _, ok := child.Args["_field"].(string); !ok { + fieldName, ok := child.Args["_field"].(string) + if !ok { return nil, errors.Errorf("%s call must have field with valid (string) field name. Got %v of type %[2]T", child.Name, child.Args["_field"]) } - f := idx.Field(child.Args["_field"].(string)) + f := idx.Field(fieldName) if f == nil { return nil, ErrFieldNotFound } diff --git a/executor_test.go b/executor_test.go index bf146ab50..6bf3f2a14 100644 --- a/executor_test.go +++ b/executor_test.go @@ -2997,7 +2997,7 @@ func TestExecutor_Execute_Remote_Row(t *testing.T) { } }) - t.Run("groupbBy on ints with offset regression", func(t *testing.T) { + t.Run("groupBy on ints with offset regression", func(t *testing.T) { _, err = c[0].API.CreateField(context.Background(), "i", "hint", pilosa.OptFieldTypeInt(1, 1000)) if err != nil { t.Fatalf("creating field: %v", err)