@@ -29,3 +29,44 @@ def test_concat_rows():
2929 ops = ops4 ,
3030 data = {'d1' : d1 , 'd2' : d2 },
3131 expect = expect )
32+
33+
34+ def test_if_concat_is_stoopid_1 ():
35+ # look if concat is concating by position intead of name
36+ d1 = data_algebra .default_data_model .pd .DataFrame (
37+ {"x" : ['a' ], "y" : ['b' ]}
38+ )
39+
40+ d2 = data_algebra .default_data_model .pd .DataFrame (
41+ {"y" : ['c' ], "x" : ['d' ]}
42+ )
43+
44+ ops = describe_table (d1 , "d1" ).concat_rows (b = describe_table (d2 , "d2" ), id_column = None )
45+
46+ expect = data_algebra .default_data_model .pd .DataFrame (
47+ {"x" : ['a' , 'd' ], "y" : ['b' , 'c' ]}
48+ )
49+
50+ data_algebra .test_util .check_transform (
51+ ops = ops ,
52+ data = {'d1' : d1 , 'd2' : d2 },
53+ expect = expect )
54+
55+
56+ def test_if_concat_is_stoopid_2 ():
57+ # look if concat is concating by position intead of name
58+ d1 = data_algebra .default_data_model .pd .DataFrame (
59+ {"x" : ['a' ], "y" : ['b' ]}
60+ )
61+
62+ descr = describe_table (d1 , "d1" )
63+ ops = descr .concat_rows (b = descr .select_columns (['y' , 'x' ]), id_column = None )
64+
65+ expect = data_algebra .default_data_model .pd .DataFrame (
66+ {"x" : ['a' , 'a' ], "y" : ['b' , 'b' ]}
67+ )
68+
69+ data_algebra .test_util .check_transform (
70+ ops = ops ,
71+ data = d1 ,
72+ expect = expect )
0 commit comments