Skip to content

Commit

Permalink
Ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ugohuche committed Jun 14, 2024
1 parent aeff68a commit 07df4ff
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/expr/str/contains_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
import narwhals as nw
from tests.utils import compare_dicts

data = {
"pets": ["cat", "dog", "rabbit and parrot", "dove"]
}
data = {"pets": ["cat", "dog", "rabbit and parrot", "dove"]}

df_pandas = pd.DataFrame(data)
df_polars = pl.DataFrame(data)


@pytest.mark.parametrize("df_any", [df_pandas, df_polars])
def test_contains(df_any: Any) -> None:
df = nw.from_native(df_any, eager_only=True)
Expand All @@ -22,10 +21,10 @@ def test_contains(df_any: Any) -> None:
)
expected = {
"pets": ["cat", "dog", "rabbit and parrot", "dove"],
"case_insensitive_match": [False, False, True, True]
"case_insensitive_match": [False, False, True, True],
}
compare_dicts(result, expected)
result = df.with_columns(
case_insensitive_match=df["pets"].str.contains("(?i)parrot|Dove")
)
compare_dicts(result, expected)
compare_dicts(result, expected)

0 comments on commit 07df4ff

Please sign in to comment.