Skip to content

Commit e06804d

Browse files
committed
bug fix - flatten column with type Any
1 parent aa177e4 commit e06804d

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

src/dataset/transpose.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,11 +759,11 @@ function _ELTYPE(x::Missing)
759759
end
760760

761761

762-
function _LENGTH(x)
762+
function _LENGTH(x)::Int
763763
length(x)
764764
end
765765

766-
function _LENGTH(x::Missing)
766+
function _LENGTH(x::Missing)::Int
767767
1
768768
end
769769

test/transpose.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,11 @@ end
604604
@test flatten(view(ds, [1,2,5,10], [2,3,1]), :y, threads = true) == flatten!(ds[[1,2,5,10], [2,3,1]], :y, threads = false)
605605
@test flatten(view(ds, [1,2,5,10], [2,3,1]), :z, mapformats = true, threads = false) == flatten!(ds[[1,2,5,10], [2,3,1]], :z, mapformats = true, threads = true)
606606
end
607-
607+
ds = Dataset(x=1:3, y=[[1,2],[],[[],[]]])
608+
@test flatten(flatten(ds,2), 2) == Dataset(x=[1,1], y=[1,2])
609+
flatten!(ds, 2)
610+
flatten!(ds, :y)
611+
@test ds == Dataset(x=[1,1], y=[1,2])
608612
end
609613

610614
@testset "transpose - views" begin

0 commit comments

Comments
 (0)