77import  narwhals .stable .v1  as  nw 
88from  tests .utils  import  PYARROW_VERSION 
99from  tests .utils  import  Constructor 
10+ from  tests .utils  import  ConstructorEager 
1011from  tests .utils  import  assert_equal_data 
1112
1213
@@ -30,13 +31,22 @@ def test_with_columns_order(constructor: Constructor) -> None:
3031    assert_equal_data (result , expected )
3132
3233
33- def  test_with_columns_empty (constructor :  Constructor ) ->  None :
34+ def  test_with_columns_empty (constructor_eager :  ConstructorEager ) ->  None :
3435    data  =  {"a" : [1 , 3 , 2 ], "b" : [4 , 4 , 6 ], "z" : [7.0 , 8.0 , 9.0 ]}
35-     df  =  nw .from_native (constructor (data ))
36+     df  =  nw .from_native (constructor_eager (data ))
3637    result  =  df .select ().with_columns ()
3738    assert_equal_data (result , {})
3839
3940
41+ def  test_select_with_columns_empty_lazy (constructor : Constructor ) ->  None :
42+     data  =  {"a" : [1 , 3 , 2 ], "b" : [4 , 4 , 6 ], "z" : [7.0 , 8.0 , 9.0 ]}
43+     df  =  nw .from_native (constructor (data )).lazy ()
44+     with  pytest .raises (ValueError , match = "At least one" ):
45+         df .with_columns ()
46+     with  pytest .raises (ValueError , match = "At least one" ):
47+         df .select ()
48+ 
49+ 
4050def  test_with_columns_order_single_row (constructor : Constructor ) ->  None :
4151    data  =  {"a" : [1 , 3 , 2 ], "b" : [4 , 4 , 6 ], "z" : [7.0 , 8.0 , 9.0 ], "i" : [0 , 1 , 2 ]}
4252    df  =  nw .from_native (constructor (data )).filter (nw .col ("i" ) <  1 ).drop ("i" )
0 commit comments