99from narwhals .exceptions import MultiOutputExpressionError
1010from tests .utils import NUMPY_VERSION , POLARS_VERSION , Constructor
1111
12- if TYPE_CHECKING :
13- from narwhals .typing import Frame
14-
15-
1612T = TypeVar ("T" )
1713
1814
2117)
2218def test_all_vs_all (constructor : Constructor ) -> None :
2319 data = {"a" : [1 , 3 , 2 ], "b" : [4 , 4 , 6 ]}
24- df : Frame = nw .from_native (constructor (data ))
20+ df = nw .from_native (constructor (data ))
2521 with pytest .raises (MultiOutputExpressionError ):
2622 df .lazy ().select (nw .all () + nw .col ("b" , "a" )).collect ()
2723
2824
2925def test_invalid () -> None :
3026 data = {"a" : [1 , 3 , 2 ], "b" : [4 , 4 , 6 ], "z" : [7.0 , 8.0 , 9.0 ]}
31- df : Frame = nw .from_native (pd .DataFrame (data ))
27+ df = nw .from_native (pd .DataFrame (data ))
3228 with pytest .raises (ValueError , match = "Multi-output" ):
3329 df .select (nw .all () + nw .all ())
3430
@@ -37,7 +33,7 @@ def test_invalid_pyarrow() -> None:
3733 pytest .importorskip ("pyarrow" )
3834 import pyarrow as pa
3935
40- df : Frame = nw .from_native (pa .table ({"a" : [1 , 2 ], "b" : [3 , 4 ]}))
36+ df = nw .from_native (pa .table ({"a" : [1 , 2 ], "b" : [3 , 4 ]}))
4137 with pytest .raises (MultiOutputExpressionError ):
4238 df .select (nw .all () + nw .all ())
4339
@@ -47,7 +43,7 @@ def test_invalid_polars() -> None:
4743 import polars as pl
4844
4945 data = {"a" : [1 , 3 , 2 ], "b" : [4 , 4 , 6 ], "z" : [7.0 , 8.0 , 9.0 ]}
50- df : Frame = nw .from_native (pd .DataFrame (data ))
46+ df = nw .from_native (pd .DataFrame (data ))
5147 with pytest .raises (TypeError , match = "Perhaps you" ):
5248 df .select ([pl .col ("a" )]) # type: ignore[list-item]
5349 with pytest .raises (TypeError , match = "Expected Narwhals dtype" ):
0 commit comments