Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added escape_regex operation to the str namespace and as a global function #19257

Merged
merged 17 commits into from
Oct 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
barak1412 committed Oct 18, 2024
commit 27d460b3a4d94d94149bec224b15d414a460bcfd
4 changes: 2 additions & 2 deletions py-polars/tests/unit/functions/test_functions.py
Original file line number Diff line number Diff line change
@@ -550,10 +550,10 @@ def test_escape_regex() -> None:
TypeError,
match="escape_regex function is unsupported for `Exp`, you may want use `Expr.str.escape_regex` instead",
):
df.with_columns(escaped=pl.escape_regex(pl.col("text")))
df.with_columns(escaped=pl.escape_regex(pl.col("text"))) # type: ignore[arg-type]

with pytest.raises(
TypeError,
match="escape_regex function supports only `str` type, got `<class 'int'>`",
):
pl.escape_regex(3)
pl.escape_regex(3) # type: ignore[arg-type]