Skip to content

Commit 80eeb63

Browse files
committed
BUG: fix regex numeric group replacement in PyArrow string arrays
1 parent 1863adb commit 80eeb63

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/arrays/_arrow_string_mixins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def _str_replace(
175175
or flags
176176
or (
177177
isinstance(repl, str)
178-
and (r"\g<" in repl or re.search(r"\\\d", repl) is not None)
178+
and r"\g<" in repl # Block named group references (\g<name>); numeric groups (\1) are supported by PyArrow
179179
)
180180
):
181181
raise NotImplementedError(

0 commit comments

Comments
 (0)