Skip to content

Commit

Permalink
add tests of new hashing code
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Nov 6, 2020
1 parent e3d7d2c commit 8c9f8cd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/grouping.jl
Expand Up @@ -3173,4 +3173,18 @@ end
:min => min.(df.y, df.z), :max => max.(df.y, df.z), :y => df.y) |> sort
end

@testset "hashing of pooled vectors" begin
for x in ([1:900; fill(1, 101)], [1:902; fill(1, 99)],
[1:900; fill(missing, 101)], [1:902; fill(missing, 99)])
x1 = PooledArray(x);
x2 = categorical(x);
@test DataFrames.hashrows((x,), false) ==
DataFrames.hashrows((x1,), false) ==
DataFrames.hashrows((x2,), false)
@test DataFrames.hashrows((x,), true) ==
DataFrames.hashrows((x1,), true) ==
DataFrames.hashrows((x2,), true)
end
end

end # module

0 comments on commit 8c9f8cd

Please sign in to comment.