Skip to content

Commit

Permalink
[BUG] Fixes regexp_replace expression (#3306)
Browse files Browse the repository at this point in the history
`regexp_replace` should set regex to True
  • Loading branch information
ConeyLiu authored Nov 19, 2024
1 parent 274f300 commit 824df2c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/daft-sql/src/modules/utf8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ utf8_function!(
utf8_function!(
SQLUtf8RegexpReplace,
"regexp_replace",
|input, pattern, replacement| daft_functions::utf8::replace(input, pattern, replacement, false),
|input, pattern, replacement| daft_functions::utf8::replace(input, pattern, replacement, true),
"Replaces all occurrences of a substring with a new string",
"string_input",
"pattern",
Expand Down
2 changes: 1 addition & 1 deletion tests/sql/test_utf8_exprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_utf8_exprs():
col("a").str.extract("ba.").alias("extract_a"),
col("a").str.extract_all("ba.").alias("extract_all_a"),
col("a").str.split(r"\s+", regex=True).alias("regexp_split_a"),
col("a").str.replace("ba.", "foo").alias("replace_a"),
col("a").str.replace("ba.", "foo", regex=True).alias("replace_a"),
col("a").str.length().alias("length_a"),
col("a").str.length_bytes().alias("length_bytes_a"),
col("a").str.lower().alias("lower_a"),
Expand Down

0 comments on commit 824df2c

Please sign in to comment.