66
77import narwhals as nw
88from tests .utils import (
9+ PANDAS_VERSION ,
910 Constructor ,
1011 ConstructorEager ,
1112 IntoIterable ,
@@ -60,8 +61,20 @@ def test_filter_is_in_with_series(constructor_eager: ConstructorEager) -> None:
6061
6162@pytest .mark .slow
6263def test_expr_is_in_iterable (
63- constructor : Constructor , into_iter_16 : IntoIterable
64+ constructor : Constructor , into_iter_16 : IntoIterable , request : pytest . FixtureRequest
6465) -> None :
66+ test_name = request .node .name
67+ request .applymarker (
68+ pytest .mark .xfail (
69+ all (part in test_name for part in ("duckdb" , "pandas" , "array" ))
70+ and PANDAS_VERSION < (2 ,),
71+ reason = (
72+ "Pandas bug produced numpy scalars on `pd.array(...).tolist()`\n "
73+ "Not implemented Error: Unable to transform python value of type '<class 'numpy.int64'>' to DuckDB LogicalType\n "
74+ "https://github.com/pandas-dev/pandas/pull/49890"
75+ ),
76+ )
77+ )
6578 df = nw .from_native (constructor (data ))
6679 expected = {"a" : [False , True , True , False ]}
6780 iterable = into_iter_16 ((4 , 2 ))
@@ -83,7 +96,7 @@ def test_ser_is_in_iterable(
8396 # NOTE: This *could* be supported by using `ExtensionArray.tolist` (same path as numpy)
8497 request .applymarker (
8598 pytest .mark .xfail (
86- ( "polars" in test_name and "pandas" in test_name and "array" in test_name ),
99+ all ( part in test_name for part in ( "polars" , "pandas" , "array" ) ),
87100 raises = TypeError ,
88101 reason = "Polars doesn't support `pd.array`.\n https://github.com/pola-rs/polars/issues/22757" ,
89102 )
0 commit comments