@@ -10,16 +10,16 @@ include("test_source_without_length.jl")
10
10
@test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable (nothing , errorhandling= :error )
11
11
@test TableTraitsUtils. create_columns_from_iterabletable (nothing , errorhandling= :returnvalue ) === nothing
12
12
13
- @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable ([1 ,2 , 3 ])
14
- @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable ([1 ,2 , 3 ], errorhandling= :error )
15
- @test TableTraitsUtils. create_columns_from_iterabletable ([1 ,2 , 3 ], errorhandling= :returnvalue ) === nothing
13
+ @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable ([1 , 2 , 3 ])
14
+ @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable ([1 , 2 , 3 ], errorhandling= :error )
15
+ @test TableTraitsUtils. create_columns_from_iterabletable ([1 , 2 , 3 ], errorhandling= :returnvalue ) === nothing
16
16
17
- @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable (Iterators. filter (i -> true , [1 ,2 , 3 ]))
18
- @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable (Iterators. filter (i -> true , [1 ,2 , 3 ]), errorhandling= :error )
19
- @test TableTraitsUtils. create_columns_from_iterabletable (Iterators. filter (i -> true , [1 ,2 , 3 ]), errorhandling= :returnvalue ) === nothing
17
+ @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable (Iterators. filter (i -> true , [1 , 2 , 3 ]))
18
+ @test_throws ArgumentError TableTraitsUtils. create_columns_from_iterabletable (Iterators. filter (i -> true , [1 , 2 , 3 ]), errorhandling= :error )
19
+ @test TableTraitsUtils. create_columns_from_iterabletable (Iterators. filter (i -> true , [1 , 2 , 3 ]), errorhandling= :returnvalue ) === nothing
20
20
21
- @test create_columns_from_iterabletable (NamedTuple{(:a , :b ),Tuple{Int,String}}[]) == (Any[Int[],String[]], [:a ,:b ])
22
- @test create_columns_from_iterabletable ((i for i in NamedTuple{(:a , :b ),Tuple{Int,String}}[])) == (Any[Int[],String[]], [:a ,:b ])
21
+ @test create_columns_from_iterabletable (NamedTuple{(:a , :b ),Tuple{Int,String}}[]) == (Any[Int[], String[]], [:a , :b ])
22
+ @test create_columns_from_iterabletable ((i for i in NamedTuple{(:a , :b ),Tuple{Int,String}}[])) == (Any[Int[], String[]], [:a , :b ])
23
23
24
24
@test_throws ArgumentError create_columns_from_iterabletable (Int[])
25
25
@test_throws ArgumentError create_columns_from_iterabletable (Int[], errorhandling= :error )
@@ -28,7 +28,7 @@ include("test_source_without_length.jl")
28
28
@test_throws ArgumentError create_columns_from_iterabletable ((i for i in Int[]), errorhandling= :error )
29
29
@test create_columns_from_iterabletable ((i for i in Int[]), errorhandling= :returnvalue ) === nothing
30
30
31
- columns = (Int[1 ,2 , 3 ], Float64[1. , 2. , 3. ], String[" John" , " Sally" , " Drew" ])
31
+ columns = (Int[1 , 2 , 3 ], Float64[1.0 , 2.0 , 3.0 ], String[" John" , " Sally" , " Drew" ])
32
32
names = [:children , :age , :name ]
33
33
34
34
it = TableTraitsUtils. create_tableiterator (columns, names)
@@ -37,7 +37,7 @@ include("test_source_without_length.jl")
37
37
38
38
columns3, names3 = TableTraitsUtils. create_columns_from_iterabletable (it, sel_cols= :all )
39
39
40
- columns23, names23 = TableTraitsUtils. create_columns_from_iterabletable (it, sel_cols= [2 ,3 ])
40
+ columns23, names23 = TableTraitsUtils. create_columns_from_iterabletable (it, sel_cols= [2 , 3 ])
41
41
42
42
@test columns[1 ] == columns2[1 ] == columns3[1 ]
43
43
@test columns[2 ] == columns2[2 ] == columns3[2 ]
@@ -50,48 +50,48 @@ include("test_source_without_length.jl")
50
50
@test names == names2 == names3
51
51
@test names[2 : 3 ] == names23
52
52
53
- @test isequal (create_columns_from_iterabletable ([(a = DataValue {Any} (), b = DataValue {Int} ())], na_representation= :missing ),
54
- ([Any[missing ], Union{Missing,Int}[missing ]], [:a , :b ])
55
- )
53
+ @test isequal (create_columns_from_iterabletable ([(a= DataValue {Any} (), b= DataValue {Int} ())], na_representation= :missing ),
54
+ ([Any[missing ], Union{Missing,Int}[missing ]], [:a , :b ])
55
+ )
56
56
57
- @test create_columns_from_iterabletable ([(a = DataValue {Any} (), b = DataValue {Int} ())], na_representation= :datavalue ) ==
58
- ([DataValue{Any}[NA], DataValue{Int}[NA]], [:a , :b ])
57
+ @test create_columns_from_iterabletable ([(a= DataValue {Any} (), b= DataValue {Int} ())], na_representation= :datavalue ) ==
58
+ ([DataValue{Any}[NA], DataValue{Int}[NA]], [:a , :b ])
59
59
60
60
it2 = TestSourceWithoutLength ()
61
61
62
62
columns4, names4 = TableTraitsUtils. create_columns_from_iterabletable (it2)
63
- @test columns4[1 ] == [1 ,2 ]
64
- @test columns4[2 ] == [1. , 2. ]
63
+ @test columns4[1 ] == [1 , 2 ]
64
+ @test columns4[2 ] == [1.0 , 2.0 ]
65
65
@test names4 == [:a , :b ]
66
66
67
67
columns5, names5 = TableTraitsUtils. create_columns_from_iterabletable (it2, sel_cols= :all )
68
- @test columns5[1 ] == [1 ,2 ]
69
- @test columns5[2 ] == [1. , 2. ]
68
+ @test columns5[1 ] == [1 , 2 ]
69
+ @test columns5[2 ] == [1.0 , 2.0 ]
70
70
@test names5 == [:a , :b ]
71
71
72
72
columns6, names6 = TableTraitsUtils. create_columns_from_iterabletable (it2, sel_cols= [2 ])
73
- @test columns6[1 ] == [1. , 2. ]
73
+ @test columns6[1 ] == [1.0 , 2.0 ]
74
74
@test names6 == [:b ]
75
75
76
- columns_with_nulls = (Union{Int,Missing}[3 , 2 , missing ], Float64[2. , 5. , 9. ], Union{String,Missing}[" a" , missing , " b" ])
76
+ columns_with_nulls = (Union{Int,Missing}[3 , 2 , missing ], Float64[2.0 , 5.0 , 9.0 ], Union{String,Missing}[" a" , missing , " b" ])
77
77
it3 = TableTraitsUtils. create_tableiterator (columns_with_nulls, names)
78
78
79
79
columns7, names7 = TableTraitsUtils. create_columns_from_iterabletable (it3)
80
80
81
- @test columns7[1 ] == [3 ,2 , NA]
82
- @test columns7[2 ] == [2. , 5. , 9. ]
83
- @test columns7[3 ] == [" a" ,NA," b" ]
81
+ @test columns7[1 ] == [3 , 2 , NA]
82
+ @test columns7[2 ] == [2.0 , 5.0 , 9.0 ]
83
+ @test columns7[3 ] == [" a" , NA, " b" ]
84
84
@test length (columns7) == 3
85
85
@test names7 == names
86
86
87
- columns_with_DV = ([3 , 2 , NA], [2. , 5. , 9. ], [" a" , NA, " b" ])
87
+ columns_with_DV = ([3 , 2 , NA], [2.0 , 5.0 , 9.0 ], [" a" , NA, " b" ])
88
88
it4 = TableTraitsUtils. create_tableiterator (columns_with_DV, names)
89
89
90
90
columns8, names8 = TableTraitsUtils. create_columns_from_iterabletable (it4)
91
91
92
- @test columns8[1 ] == [3 ,2 , NA]
93
- @test columns8[2 ] == [2. , 5. , 9. ]
94
- @test columns8[3 ] == [" a" ,NA," b" ]
92
+ @test columns8[1 ] == [3 , 2 , NA]
93
+ @test columns8[2 ] == [2.0 , 5.0 , 9.0 ]
94
+ @test columns8[3 ] == [" a" , NA, " b" ]
95
95
@test length (columns8) == 3
96
96
@test names8 == names
97
97
0 commit comments