11from __future__ import annotations
22
3- import pytest
4-
53import narwhals as nw
6- from tests .utils import POLARS_VERSION , ConstructorEager , assert_equal_data
4+ from tests .utils import ConstructorEager , assert_equal_data
75
86data = {"a" : [1 , 2 , 3 ], "b" : [4 , 5 , 6 ], "z" : [7.0 , 8.0 , 9.0 ]}
97
@@ -14,12 +12,7 @@ def test_map_batches_expr(constructor_eager: ConstructorEager) -> None:
1412 assert_equal_data (expected , {"a" : [2 , 3 , 4 ], "b" : [5 , 6 , 7 ]})
1513
1614
17- def test_map_batches_expr_numpy (
18- request : pytest .FixtureRequest , constructor_eager : ConstructorEager
19- ) -> None :
20- if "polars" in str (constructor_eager ) and POLARS_VERSION <= (0 , 20 , 3 ):
21- request .applymarker (pytest .mark .xfail )
22-
15+ def test_map_batches_expr_numpy (constructor_eager : ConstructorEager ) -> None :
2316 df = nw .from_native (constructor_eager (data ))
2417 expected = df .select (
2518 nw .col ("a" )
@@ -32,12 +25,7 @@ def test_map_batches_expr_numpy(
3225 assert_equal_data (expected , {"a" : [2 ], "b" : [2 ], "z" : [2 ]})
3326
3427
35- def test_map_batches_expr_names (
36- request : pytest .FixtureRequest , constructor_eager : ConstructorEager
37- ) -> None :
38- if "polars" in str (constructor_eager ) and POLARS_VERSION <= (0 , 20 , 3 ):
39- request .applymarker (pytest .mark .xfail )
40-
28+ def test_map_batches_expr_names (constructor_eager : ConstructorEager ) -> None :
4129 df = nw .from_native (constructor_eager (data ))
4230 expected = nw .from_native (df .select (nw .all ().map_batches (lambda x : x .to_numpy ())))
4331 assert_equal_data (expected , {"a" : [1 , 2 , 3 ], "b" : [4 , 5 , 6 ], "z" : [7.0 , 8.0 , 9.0 ]})
0 commit comments