From 96865ed6879aba47937457a43d5bf2be2837798f Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Mon, 29 Aug 2016 18:14:50 +0200 Subject: [PATCH] Remove FIXME about insert!() For now, preserve the current semantics: conversion to NullableArray does not happen via insert!(). --- test/dataframe.jl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test/dataframe.jl b/test/dataframe.jl index 260c8ac4a0..37b8722271 100644 --- a/test/dataframe.jl +++ b/test/dataframe.jl @@ -98,13 +98,11 @@ module TestDataFrame df = DataFrame(a=[1, 2], b=[3., 4.]) @test_throws BoundsError insert!(df, 5, ["a", "b"], :newcol) @test_throws ErrorException insert!(df, 1, ["a"], :newcol) - # FIXME: should we convert to NullableArray automatically? - @test isequal(insert!(df, 1, NullableArray(["a", "b"]), :newcol), df) - @test isequal(df, DataFrame(newcol=["a", "b"], a=[1, 2], b=[3., 4.])) - df = DataFrame(a=[1, 2], b=[3., 4.]) - # FIXME: should we convert to NullableArray automatically? - @test isequal(insert!(df, 3, NullableArray(["a", "b"]), :newcol), df) - @test isequal(df, DataFrame(a=[1, 2], b=[3., 4.], newcol=["a", "b"])) + @test isequal(insert!(df, 1, ["a", "b"], :newcol), df) + @test names(df) == [:newcol, :a, :b] + @test isequal(df[:a], NullableArray([1, 2])) + @test isequal(df[:b], NullableArray([3., 4.])) + @test isequal(df[:newcol], ["a", "b"]) df = DataFrame(a=[1, 2], b=[3., 4.]) df2 = DataFrame(b=["a", "b"], c=[:c, :d])