@@ -173,12 +173,11 @@ end
173173 @test isempty (dropmissing! (DataFrame ())) && dropmissing! (DataFrame ()) isa DataFrame
174174 df = DataFrame (a= 1 : 3 , b= 4 : 6 )
175175 dfv = @view df[:, 2 : 1 ]
176- # TODO : re-enable after https://github.com/JuliaData/DataFrames.jl/issues/3272 is resolved
177- # @test isempty(dropmissing(dfv)) && dropmissing(dfv) isa DataFrame
176+ @test isempty (dropmissing (dfv)) && dropmissing (dfv) isa DataFrame
178177 @test_throws ArgumentError dropmissing! (dfv)
179- @test_throws ArgumentError dropmissing (df1, [])
180- @test_throws ArgumentError dropmissing! (df1, [])
181-
178+ @test_throws ArgumentError dropmissing (df1, [])
179+ @test_throws ArgumentError dropmissing! (df1, [])
180+
182181 df = DataFrame (a= [1 , missing , 3 ])
183182 sdf = view (df, :, :)
184183 @test dropmissing (sdf) == DataFrame (a= [1 , 3 ])
@@ -248,19 +247,26 @@ end
248247 # Deterministic drop mask: IF remainder of index position divided by 10 == column index THEN missing
249248 for i in 1 : ncol (df)
250249 missing_mask = (eachindex (df[! , i]) .% 10 ) .== i
251- df[missing_mask, i] .= missing
250+ df[missing_mask, i] .= missing
252251 end
253-
252+
254253 notmissing_rows = [i for i in 1 : N_rows if i % 10 == 0 || i % 10 > ncol (df)]
255254 @test dropmissing (df) ≅ df[notmissing_rows, :]
256-
255+
257256 cols = [:x1 , :x2 ]
258257 notmissing_rows = [i for i in 1 : N_rows if i % 10 == 0 || i % 10 > length (cols)]
259258 returned = dropmissing (df, cols)
260259 @test returned ≅ df[notmissing_rows, :]
261260 @test eltype (returned[:, cols[1 ]]) == nonmissingtype (eltype (df[:, cols[1 ]]))
262261 @test eltype (returned[:, cols[2 ]]) == nonmissingtype (eltype (df[:, cols[2 ]]))
263262 @test eltype (returned[:, ncol (df)]) == eltype (df[:, ncol (df)])
263+
264+ # correct handling of not propagating views
265+ df = DataFrame (a= 1 : 3 , b= Any[11 , missing , 13 ])
266+ df2 = dropmissing (df)
267+ @test df2 == DataFrame (a= [1 , 3 ], b= [11 , 13 ])
268+ @test df2. a isa Vector{Int}
269+ @test df2. b isa Vector{Any}
264270end
265271
266272@testset " deleteat! https://github.com/JuliaLang/julia/pull/41646 bug workaround" begin
0 commit comments