Skip to content

Commit

Permalink
deps: remove testify dependency
Browse files Browse the repository at this point in the history
Signed-off-by: Achille Roussel <[email protected]>
  • Loading branch information
achille-roussel committed Aug 14, 2024
1 parent 4bdfcaf commit caa3ed2
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 26 deletions.
29 changes: 21 additions & 8 deletions column_index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

"github.com/parquet-go/parquet-go"
"github.com/stretchr/testify/require"
)

func TestBinaryColumnIndexMinMax(t *testing.T) {
Expand Down Expand Up @@ -69,8 +68,12 @@ func Test_ColumnIndexReuse(t *testing.T) {
parquet.ValueOf(max),
)
before := indexer.ColumnIndex()
require.Equal(t, 1, len(before.NullPages))
require.False(t, before.NullPages[0])
if len(before.NullPages) != 1 {
t.Fatalf("expected 1 null page, got %d", len(before.NullPages))
}
if !before.NullPages[0] {
t.Fatalf("expected null page 0")
}

// Reset the indexer. Should be safe for reuse.
indexer.Reset()
Expand All @@ -86,11 +89,21 @@ func Test_ColumnIndexReuse(t *testing.T) {
)
after := indexer.ColumnIndex()

require.Equal(t, 2, len(after.NullPages))
require.True(t, after.NullPages[0])
require.True(t, after.NullPages[1])
if len(after.NullPages) != 2 {
t.Fatalf("expected 2 null pages, got %d", len(after.NullPages))
}
if !after.NullPages[0] {
t.Fatalf("expected null page 0")
}
if !after.NullPages[1] {
t.Fatalf("expected null page 1")
}

// Validate null pages of the previous index.
require.Equal(t, 1, len(before.NullPages))
require.False(t, before.NullPages[0])
if len(before.NullPages) != 1 {
t.Fatalf("expected 1 null page, got %d", len(before.NullPages))
}
if !before.NullPages[0] {
t.Fatalf("expected null page 0")
}
}
4 changes: 0 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,11 @@ require (
github.com/klauspost/compress v1.17.9
github.com/olekukonko/tablewriter v0.0.5
github.com/pierrec/lz4/v4 v4.1.21
github.com/stretchr/testify v1.9.0
golang.org/x/sys v0.21.0
google.golang.org/protobuf v1.34.2
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
10 changes: 0 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand All @@ -17,20 +15,12 @@ github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/pierrec/lz4/v4 v4.1.21 h1:yOVMLb6qSIDP67pl/5F7RepeKYu/VmTyEXvuMI5d9mQ=
github.com/pierrec/lz4/v4 v4.1.21/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
13 changes: 9 additions & 4 deletions sorting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

"github.com/parquet-go/parquet-go"
"github.com/stretchr/testify/require"
)

func TestSortingWriter(t *testing.T) {
Expand Down Expand Up @@ -354,16 +353,22 @@ func TestMergedRowsCorruptedString(t *testing.T) {
}

f, err := parquet.OpenFile(bytes.NewReader(buffer.Bytes()), int64(buffer.Len()))
require.NoError(t, err)
if err != nil {
t.Fatal(err)
}
files[i] = f
}

// Merge the row groups from the separate files.
merged, err := parquet.MergeRowGroups([]parquet.RowGroup{files[0].RowGroups()[0], files[1].RowGroups()[0]},
parquet.SortingRowGroupConfig(parquet.SortingColumns(parquet.Ascending("tag"))),
)
require.NoError(t, err)
require.Equal(t, rowCount, int(merged.NumRows()))
if err != nil {
t.Fatal(err)
}
if merged.NumRows() != int64(rowCount) {
t.Fatal("number of rows mismatched: want", rowCount, "but got", merged.NumRows())
}

// Validate the merged rows.
reader := merged.Rows()
Expand Down

0 comments on commit caa3ed2

Please sign in to comment.