File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -272,3 +272,20 @@ def test_arrow_table_narrows():
272272 d >> ops
273273 res2 = d .loc [:, ["x" ]] >> ops
274274 assert data_algebra .test_util .equivalent_frames (res2 , expect )
275+
276+
277+ def test_arrow_identity ():
278+ pd = data_algebra .data_model .default_data_model ().pd
279+ d = pd .DataFrame ({"x" : [1 , 2 ]})
280+ ops = data_algebra .descr (d = d ).extend ({"y" : "x + 1" })
281+ dl = data_algebra .TableDescription (table_name = "d" , column_names = ["x" ])
282+ ops_2 = dl >> ops
283+ assert ops_2 == ops
284+ dr = data_algebra .TableDescription (table_name = "d2" , column_names = ["x" , "y" ])
285+ ops_3 = ops >> dr
286+ assert ops_3 == ops
287+ assert (dl >> dl ) == dl
288+ assert (dr >> dr ) == dr
289+ assert dl != dr
290+ res = d >> dl
291+ assert data_algebra .test_util .equivalent_frames (d , res )
You can’t perform that action at this time.
0 commit comments