2020 "ςpecial caσe" , # noqa: RUF001
2121 ]
2222 },
23- {"a" : ["SPECIAL CASE SS " , "ΣPECIAL CAΣE" ]},
23+ {"a" : ["SPECIAL CASE ẞ " , "ΣPECIAL CAΣE" ]},
2424 ),
2525 ],
2626)
2727def test_str_to_uppercase (
2828 constructor : Constructor ,
2929 data : dict [str , list [str ]],
3030 expected : dict [str , list [str ]],
31- request : pytest .FixtureRequest ,
3231) -> None :
33- if any ("ß" in s for value in data .values () for s in value ) & (
34- constructor .__name__
35- in {
36- "pandas_pyarrow_constructor" ,
37- "pyarrow_table_constructor" ,
38- "modin_pyarrow_constructor" ,
39- "duckdb_lazy_constructor" ,
40- "sqlframe_pyspark_lazy_constructor" ,
41- }
42- or ("dask" in str (constructor ) and PYARROW_VERSION >= (12 ,))
32+ if "dask" in str (constructor ) and PYARROW_VERSION < (12 ,):
33+ pytest .skip ()
34+
35+ if (
36+ any (
37+ x in str (constructor )
38+ for x in ("pandas_constructor" , "pandas_nullable" , "polars" )
39+ )
40+ and "ẞ" in expected ["a" ][0 ]
4341 ):
44- # We are marking it xfail for these conditions above
45- # since the pyarrow backend will convert
46- # smaller cap 'ß' to upper cap 'ẞ' instead of 'SS'
47- request .applymarker (pytest .mark .xfail )
42+ expected = {"a" : ["SPECIAL CASE SS" , "ΣPECIAL CAΣE" ]}
43+
4844 df = nw .from_native (constructor (data ))
4945 result_frame = df .select (nw .col ("a" ).str .to_uppercase ())
5046
@@ -62,33 +58,25 @@ def test_str_to_uppercase(
6258 "ςpecial caσe" , # noqa: RUF001
6359 ]
6460 },
65- {"a" : ["SPECIAL CASE SS " , "ΣPECIAL CAΣE" ]},
61+ {"a" : ["SPECIAL CASE ẞ " , "ΣPECIAL CAΣE" ]},
6662 ),
6763 ],
6864)
6965def test_str_to_uppercase_series (
7066 constructor_eager : ConstructorEager ,
7167 data : dict [str , list [str ]],
7268 expected : dict [str , list [str ]],
73- request : pytest .FixtureRequest ,
7469) -> None :
7570 df = nw .from_native (constructor_eager (data ), eager_only = True )
7671
77- if any ("ß" in s for value in data .values () for s in value ) & (
78- constructor_eager .__name__
79- not in {
80- "pandas_constructor" ,
81- "pandas_nullable_constructor" ,
82- "polars_eager_constructor" ,
83- "cudf_constructor" ,
84- "duckdb_lazy_constructor" ,
85- "modin_constructor" ,
86- }
72+ if (
73+ any (
74+ x in str (constructor_eager )
75+ for x in ("pandas_constructor" , "pandas_nullable" , "polars" )
76+ )
77+ and "ẞ" in expected ["a" ][0 ]
8778 ):
88- # We are marking it xfail for these conditions above
89- # since the pyarrow backend will convert
90- # smaller cap 'ß' to upper cap 'ẞ' instead of 'SS'
91- request .applymarker (pytest .mark .xfail )
79+ expected = {"a" : ["SPECIAL CASE SS" , "ΣPECIAL CAΣE" ]}
9280
9381 result_series = df ["a" ].str .to_uppercase ()
9482 assert_equal_data ({"a" : result_series }, expected )
0 commit comments