@@ -406,32 +406,6 @@ def test_filter_fusion_distinct_table_objects(con):
406
406
assert_equal (expr , expr4 )
407
407
408
408
409
- def test_relabel ():
410
- table = api .table ({"x" : "int32" , "y" : "string" , "z" : "double" })
411
-
412
- # Using a mapping
413
- with pytest .warns (FutureWarning , match = "Table.rename" ):
414
- res = table .relabel ({"x" : "x_1" , "y" : "y_1" }).schema ()
415
- sol = sch .schema ({"x_1" : "int32" , "y_1" : "string" , "z" : "double" })
416
- assert_equal (res , sol )
417
-
418
- # Using a function
419
- with pytest .warns (FutureWarning , match = "Table.rename" ):
420
- res = table .relabel (lambda x : None if x == "z" else f"{ x } _1" ).schema ()
421
- assert_equal (res , sol )
422
-
423
- # Using a format string
424
- with pytest .warns (FutureWarning , match = "Table.rename" ):
425
- res = table .relabel ("_{name}_" )
426
- sol = table .relabel ({"x" : "_x_" , "y" : "_y_" , "z" : "_z_" })
427
- assert_equal (res , sol )
428
-
429
- # Mapping with unknown columns errors
430
- with pytest .raises (com .IbisTypeError , match = "'missing' is not found in table" ):
431
- with pytest .warns (FutureWarning , match = "Table.rename" ):
432
- table .relabel ({"missing" : "oops" })
433
-
434
-
435
409
def test_rename ():
436
410
table = api .table ({"x" : "int32" , "y" : "string" , "z" : "double" })
437
411
sol = sch .schema ({"x_1" : "int32" , "y_1" : "string" , "z" : "double" })
0 commit comments