@@ -269,20 +269,23 @@ def test_order_by():
269269 table = pa .table ({'a' : [1 , 2 , 3 , 4 ], 'b' : [1 , 3 , None , 2 ]})
270270 table_source = Declaration ("table_source" , TableSourceNodeOptions (table ))
271271
272- sort_keys : list [tuple [str , Literal ["ascending" , "descending" ]]] = [("b" , "ascending" )]
272+ sort_keys = [("b" , "ascending" )]
273+ sort_keys = cast (list [tuple [str , Literal ["ascending" , "descending" ]]], sort_keys )
273274 ord_opts = OrderByNodeOptions (sort_keys )
274275 decl = Declaration .from_sequence ([table_source , Declaration ("order_by" , ord_opts )])
275276 result = decl .to_table ()
276277 expected = pa .table ({"a" : [1 , 4 , 2 , 3 ], "b" : [1 , 2 , 3 , None ]})
277278 assert result .equals (expected )
278279
279- ord_opts = OrderByNodeOptions ([(field ("b" ), "descending" )]) # type: ignore[arg-type]
280+ ord_opts = OrderByNodeOptions (
281+ [(field ("b" ), "descending" )]) # type: ignore[arg-type]
280282 decl = Declaration .from_sequence ([table_source , Declaration ("order_by" , ord_opts )])
281283 result = decl .to_table ()
282284 expected = pa .table ({"a" : [2 , 4 , 1 , 3 ], "b" : [3 , 2 , 1 , None ]})
283285 assert result .equals (expected )
284286
285- ord_opts = OrderByNodeOptions ([(1 , "descending" )], null_placement = "at_start" ) # type: ignore[arg-type]
287+ ord_opts = OrderByNodeOptions (
288+ [(1 , "descending" )], null_placement = "at_start" ) # type: ignore[arg-type]
286289 decl = Declaration .from_sequence ([table_source , Declaration ("order_by" , ord_opts )])
287290 result = decl .to_table ()
288291 expected = pa .table ({"a" : [3 , 2 , 4 , 1 ], "b" : [None , 3 , 2 , 1 ]})
0 commit comments