@@ -51,9 +51,9 @@ g1 = GroupedArray(p1_missing; coalesce = true)
5151
5252p2 = repeat (1 : 5 , outer = 2 )
5353g = GroupedArray (p1_missing, p2)
54- @test g[1 ] === missing
54+ @test ismissing ( g[1 ])
5555g[3 ] = missing
56- @test g[3 ] === missing
56+ @test ismissing ( g[3 ])
5757
5858p3 = [1 ,2 ]
5959@test_throws DimensionMismatch GroupedArray (p1, p3)
@@ -64,30 +64,41 @@ g = GroupedArray(p)
6464
6565using CategoricalArrays
6666g = GroupedArray (categorical (p1_missing), categorical (p2))
67- @test g[1 ] === missing
67+ @test ismissing ( g[1 ])
6868
6969using PooledArrays
7070g = GroupedArray (PooledArray (p1_missing), PooledArray (p2))
71- @test g[1 ] === missing
71+ @test ismissing ( g[1 ])
7272
73- g = GroupedArray (PooledArray (p1_missing), p2)
74- @test g[1 ] === missing
7573
7674
7775using DataAPI
76+ g = GroupedArray (PooledArray (p1_missing), p2)
77+ @test g[1 ] === missing
7878refs = DataAPI. refarray (g)
7979pools = DataAPI. refpool (g)
8080invrefpools = DataAPI. invrefpool (g)
8181@test all (pools[refs] .=== g)
8282@test all (DataAPI. refvalue (g, refs[i]) === g[i] for i in 1 : length (g))
83-
83+ @test allunique (pools)
84+ @test size (pools) == (8 ,)
8485for x in eachindex (pools)
8586 @test invrefpools[pools[x]] == x
8687end
87- @test get (invrefpools, missing , - 1 ) == - 1
88+ @test get (invrefpools, missing , - 1 ) == 0
8889
89- pools[invrefpools[missing ]] == missing
90+ @test ismissing ( pools[invrefpools[missing ]])
9091for ix in 1 : g. ngroups
9192 pools[invrefpools[ix]] == ix
9293end
9394
95+ g = GroupedArray (p2)
96+ invrefpools = DataAPI. invrefpool (g)
97+ @test get (invrefpools, missing , - 1 ) == - 1
98+
99+
100+
101+
102+
103+
104+
0 commit comments