From 64cda894cc626130e923340bacf0c71efca618c6 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Thu, 1 Apr 2021 17:43:14 -0600 Subject: [PATCH 1/5] Get test suite passing tests again --- src/util.jl | 1 + test/test_readwrite.jl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.jl b/src/util.jl index c7f45a82..37d9cb66 100644 --- a/src/util.jl +++ b/src/util.jl @@ -240,6 +240,7 @@ function _map_params(f, T, S) end _map_params(f, T::Type{Tuple{}},S::Type{Tuple{}}) = () +_map_params(f, T::Type{NamedTuple{(), Tuple{}}},S::Type{NamedTuple{(), Tuple{}}}) = () map_params(f, ::Type{T}, ::Type{S}) where {T,S} = f(T,S) @inline _tuple_type_head(::Type{T}) where {T<:Tuple} = Base.tuple_type_head(T) diff --git a/test/test_readwrite.jl b/test/test_readwrite.jl index 7ee942eb..6b7d24f2 100644 --- a/test/test_readwrite.jl +++ b/test/test_readwrite.jl @@ -24,7 +24,7 @@ end end -path = joinpath(dirname(@__FILE__), "..","test", "sample") +path = joinpath(dirname(pathof(JuliaDB)), "..","test", "sample") files = glob("*.csv", path) const spdata_dist = loadndsparse(files, type_detect_rows=4, indexcols=1:2, usecache=false, chunks=2) @@ -41,7 +41,7 @@ const spdata = loadndsparse(files; distributed=false, header_exists=true, indexcols=1:2) -files = glob("*.csv", "sample") +files = glob("*.csv", path) shuffle_files = shuffle(files) const spdata_unordered = loadndsparse(shuffle_files; distributed=false, From 255c96e114a0ccb18e901c22e7fddfa07cf1d6fa Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Tue, 6 Apr 2021 23:52:59 -0600 Subject: [PATCH 2/5] Drop <1.3 Julia support --- .github/workflows/ci.yml | 2 +- Project.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e06faac0..b57725d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: version: - - '1.0' + - '1.3' - '1' # automatically expands to the latest stable 1.x release of Julia - 'nightly' os: diff --git a/Project.toml b/Project.toml index cc5d8426..f83773c2 100644 --- a/Project.toml +++ b/Project.toml @@ -36,7 +36,7 @@ RecipesBase = "0.7,1" StatsBase = "0.32,0.33" TextParse = "0.9.1,1" WeakRefStrings = "0.6" -julia = "1" +julia = "1.3" [extras] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" From aff4e7fc3c7f5ec4188b3e07854f10a677ee10ef Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Mon, 12 Apr 2021 22:18:12 -0600 Subject: [PATCH 3/5] Fix --- Project.toml | 2 +- src/util.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index f83773c2..cc5d8426 100644 --- a/Project.toml +++ b/Project.toml @@ -36,7 +36,7 @@ RecipesBase = "0.7,1" StatsBase = "0.32,0.33" TextParse = "0.9.1,1" WeakRefStrings = "0.6" -julia = "1.3" +julia = "1" [extras] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/util.jl b/src/util.jl index 37d9cb66..998f50ef 100644 --- a/src/util.jl +++ b/src/util.jl @@ -242,6 +242,10 @@ end _map_params(f, T::Type{Tuple{}},S::Type{Tuple{}}) = () _map_params(f, T::Type{NamedTuple{(), Tuple{}}},S::Type{NamedTuple{(), Tuple{}}}) = () +if !hasmethod(Base.reduce_empty, Tuple{typeof(Base.add_sum), Union{}}) + @noinline Base.reduce_empty(::typeof(Base.add_sum), ::Type{Union{}}) = throw(ArgumentError("reducing over an empty collection is not allowed")) +end + map_params(f, ::Type{T}, ::Type{S}) where {T,S} = f(T,S) @inline _tuple_type_head(::Type{T}) where {T<:Tuple} = Base.tuple_type_head(T) @inline _tuple_type_tail(::Type{T}) where {T<:Tuple} = Base.tuple_type_tail(T) From 39f34bf040a32fa4924a28b2aa1a77efc97cfb04 Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Mon, 12 Apr 2021 22:52:35 -0600 Subject: [PATCH 4/5] fix windows --- test/test_table.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_table.jl b/test/test_table.jl index 145b997f..59844d99 100644 --- a/test/test_table.jl +++ b/test/test_table.jl @@ -12,16 +12,16 @@ import JuliaDB: pkeynames, pkeys, excludecols, select, transform end), t, :x, select=:z) == table([1, 2], [6, 15], names=Symbol[:x, :y]) @test groupreduce(:y => (+), t, :x, select=:z) == table([1, 2], [6, 15], names=Symbol[:x, :y]) x = ndsparse(["a", "b"], [3, 4], chunks=2) - @test (keytype(x), eltype(x)) == (Tuple{String}, Int64) + @test (keytype(x), eltype(x)) == (Tuple{String}, Int) x = ndsparse((date = Date.(2014:2017),), [4:7;], chunks=2) @test x[Date("2015-01-01")] == 5 - @test (keytype(x), eltype(x)) == (Tuple{Date}, Int64) + @test (keytype(x), eltype(x)) == (Tuple{Date}, Int) x = ndsparse((["a", "b"], [3, 4]), [5, 6], chunks=2) - @test (keytype(x), eltype(x)) == (Tuple{String,Int64}, Int64) + @test (keytype(x), eltype(x)) == (Tuple{String,Int}, Int) @test x["a", 3] == 5 x = ndsparse((["a", "b"], [3, 4]), ([5, 6], [7.0, 8.0]), chunks=2) x = ndsparse((x = ["a", "a", "b"], y = [3, 4, 4]), (p = [5, 6, 7], q = [8.0, 9.0, 10.0]), chunks=2) - @test (keytype(x), eltype(x)) == (Tuple{String,Int64}, NamedTuple{(:p,:q),Tuple{Int64,Float64}}) + @test (keytype(x), eltype(x)) == (Tuple{String,Int}, NamedTuple{(:p,:q),Tuple{Int,Float64}}) @test x["a", :] == ndsparse((y = [3, 4],), Columns((p = [5, 6], q = [8.0, 9.0]))) x = ndsparse([1, 2], [3, 4], chunks=2) @test pkeynames(x) == (1,) @@ -223,7 +223,7 @@ import JuliaDB: pkeynames, pkeys, excludecols, select, transform @test isequal(convertmissing(t, DataValue), t2) @test isequal(convertmissing(t2, Missing), t) - @test typeof(column(dropmissing(t, :x), :x)) <: Dagger.DArray{Int64,1} + @test typeof(column(dropmissing(t, :x), :x)) <: Dagger.DArray{Int,1} t = table(["a", "b", "c"], [0.01, 0.05, 0.07], [2, 1, 0], names=[:n, :t, :x], chunks=2) @test filter((p->p.x / p.t < 100), t) == table(String["b", "c"], [0.05, 0.07], [1, 0], names=Symbol[:n, :t, :x]) x = ndsparse((n = ["a", "b", "c"], t = [0.01, 0.05, 0.07]), [2, 1, 0], chunks=2) From 684039020cbed14355b4d476dba2e0b13ecdbf6b Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Tue, 13 Apr 2021 08:57:35 -0600 Subject: [PATCH 5/5] fix windows --- test/test_misc.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_misc.jl b/test/test_misc.jl index e2d0537b..bd0deba5 100644 --- a/test/test_misc.jl +++ b/test/test_misc.jl @@ -28,7 +28,7 @@ end @testset "printing" begin x = distribute(NDSparse([1], [1]), 1) @test repr(x) == """ - 1-d Distributed NDSparse with 1 values (Int64) in 1 chunks: + 1-d Distributed NDSparse with 1 values ($Int) in 1 chunks: 1 │ ──┼── 1 │ 1"""