Skip to content

Commit

Permalink
Renaming unused parameters to _ (#937)
Browse files Browse the repository at this point in the history
* Renaming unused parameters to `_`

* Update golangci-lint action

* Renaming unused parameters to `_`
  • Loading branch information
metalmatze authored Nov 26, 2024
1 parent 3139e12 commit 8ee3beb
Show file tree
Hide file tree
Showing 30 changed files with 162 additions and 177 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
- uses: actions/checkout@v4

- name: golangci-lint
uses: golangci/golangci-lint-action@v6.0.1
uses: golangci/golangci-lint-action@v6.1.1
with:
version: v1.55.2
args: --timeout=10m
version: v1.62.2
8 changes: 4 additions & 4 deletions aggregate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestAggregateInconsistentSchema(t *testing.T) {
[]logicalplan.Expr{logicalplan.Col("labels.label2")},
).
Project(testCase.fn(logicalplan.Col("value")).Alias(testCase.alias)).
Execute(context.Background(), func(ctx context.Context, r arrow.Record) error {
Execute(context.Background(), func(_ context.Context, r arrow.Record) error {
r.Retain()
res = r
return nil
Expand Down Expand Up @@ -237,7 +237,7 @@ func TestAggregationProjection(t *testing.T) {
logicalplan.DynCol("labels"),
logicalplan.Col("timestamp").Gt(logicalplan.Literal(1)).Alias("timestamp"),
).
Execute(context.Background(), func(ctx context.Context, ar arrow.Record) error {
Execute(context.Background(), func(_ context.Context, ar arrow.Record) error {
records = append(records, ar)
ar.Retain()
return nil
Expand Down Expand Up @@ -425,7 +425,7 @@ func BenchmarkAggregation(b *testing.B) {
}} {
b.Run(bc.name, func(b *testing.B) {
for i := 0; i < b.N; i++ {
_ = bc.builder.Execute(ctx, func(ctx context.Context, r arrow.Record) error {
_ = bc.builder.Execute(ctx, func(_ context.Context, _ arrow.Record) error {
return nil
})
}
Expand Down Expand Up @@ -510,7 +510,7 @@ func Test_Aggregation_DynCol(t *testing.T) {
[]*logicalplan.AggregationFunction{logicalplan.Max(logicalplan.DynCol("foo"))},
nil,
).
Execute(context.Background(), func(ctx context.Context, ar arrow.Record) error {
Execute(context.Background(), func(_ context.Context, ar arrow.Record) error {
require.Equal(t, 3, int(ar.NumCols()))
require.Equal(t, 1, int(ar.NumRows()))
return nil
Expand Down
16 changes: 8 additions & 8 deletions bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func getLatest15MinInterval(ctx context.Context, b testing.TB, engine *query.Loc
},
nil,
).Execute(ctx,
func(ctx context.Context, r arrow.Record) error {
func(_ context.Context, r arrow.Record) error {
r.Retain()
result = r
return nil
Expand Down Expand Up @@ -204,7 +204,7 @@ func getDeterministicLabelValuePairForType(ctx context.Context, engine *query.Lo
if err := engine.ScanTable(tableName).
Filter(logicalplan.And(typeFilter...)).
Distinct(logicalplan.Col(label)).
Execute(ctx, func(ctx context.Context, r arrow.Record) error {
Execute(ctx, func(_ context.Context, r arrow.Record) error {
arr := r.Column(0)
for i := 0; i < arr.Len(); i++ {
if arr.IsNull(i) {
Expand Down Expand Up @@ -257,7 +257,7 @@ func BenchmarkQuery(b *testing.B) {
b.Run("Types", func(b *testing.B) {
for i := 0; i < b.N; i++ {
if err := getTypesQuery(engine).
Execute(ctx, func(ctx context.Context, r arrow.Record) error {
Execute(ctx, func(_ context.Context, r arrow.Record) error {
if r.NumRows() == 0 {
b.Fatal("expected at least one row")
}
Expand All @@ -270,7 +270,7 @@ func BenchmarkQuery(b *testing.B) {

b.Run("Labels", func(b *testing.B) {
for i := 0; i < b.N; i++ {
if err := getLabelsQuery(engine).Execute(ctx, func(ctx context.Context, r arrow.Record) error {
if err := getLabelsQuery(engine).Execute(ctx, func(_ context.Context, r arrow.Record) error {
if r.NumRows() == 0 {
b.Fatal("expected at least one row")
}
Expand All @@ -284,7 +284,7 @@ func BenchmarkQuery(b *testing.B) {
b.Run("Values", func(b *testing.B) {
for i := 0; i < b.N; i++ {
if err := getValuesForLabelQuery(engine, label).
Execute(ctx, func(ctx context.Context, r arrow.Record) error {
Execute(ctx, func(_ context.Context, r arrow.Record) error {
if r.NumRows() == 0 {
b.Fatal("expected at least one row")
}
Expand All @@ -310,7 +310,7 @@ func BenchmarkQuery(b *testing.B) {
logicalplan.Col("stacktrace"),
},
).
Execute(ctx, func(ctx context.Context, r arrow.Record) error {
Execute(ctx, func(_ context.Context, r arrow.Record) error {
if r.NumRows() == 0 {
b.Fatal("expected at least one row")
}
Expand All @@ -337,7 +337,7 @@ func BenchmarkQuery(b *testing.B) {
logicalplan.Col("timestamp"),
},
).
Execute(ctx, func(ctx context.Context, r arrow.Record) error {
Execute(ctx, func(_ context.Context, r arrow.Record) error {
if r.NumRows() == 0 {
b.Fatal("expected at least one row")
}
Expand All @@ -360,7 +360,7 @@ func BenchmarkQuery(b *testing.B) {
Filter(
logicalplan.And(fullFilter...),
).
Execute(ctx, func(ctx context.Context, r arrow.Record) error {
Execute(ctx, func(_ context.Context, r arrow.Record) error {
if r.NumRows() == 0 {
b.Fatal("expected at least one row")
}
Expand Down
3 changes: 1 addition & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ import (
"sync/atomic"
"time"

"go.opentelemetry.io/otel/trace/noop"

"github.com/apache/arrow/go/v16/arrow/ipc"
"github.com/apache/arrow/go/v16/arrow/util"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/oklog/ulid/v2"
"github.com/prometheus/client_golang/prometheus"
"go.opentelemetry.io/otel/trace"
"go.opentelemetry.io/otel/trace/noop"
"golang.org/x/exp/maps"
"golang.org/x/sync/errgroup"
"google.golang.org/protobuf/proto"
Expand Down
Loading

0 comments on commit 8ee3beb

Please sign in to comment.