File tree 3 files changed +256
-175
lines changed
3 files changed +256
-175
lines changed Original file line number Diff line number Diff line change @@ -1354,7 +1354,7 @@ def replace(
1354
1354
)
1355
1355
if len (pat ) == 1 :
1356
1356
msg += (
1357
- " In addition, single character regular expressions will"
1357
+ " In addition, single character regular expressions will "
1358
1358
"*not* be treated as literal strings when regex=True."
1359
1359
)
1360
1360
warnings .warn (msg , FutureWarning , stacklevel = 3 )
Original file line number Diff line number Diff line change @@ -449,14 +449,3 @@ def test_replace_with_compiled_regex(self):
449
449
result = s .replace ({regex : "z" }, regex = True )
450
450
expected = pd .Series (["z" , "b" , "c" ])
451
451
tm .assert_series_equal (result , expected )
452
-
453
- @pytest .mark .parametrize ("pattern" , ["^.$" , "." ])
454
- def test_str_replace_regex_default_raises_warning (self , pattern ):
455
- # https://github.com/pandas-dev/pandas/pull/24809
456
- s = pd .Series (["a" , "b" , "c" ])
457
- msg = r"The default value of regex will change from True to False"
458
- if len (pattern ) == 1 :
459
- msg += r".*single character regular expressions.*not.*literal strings"
460
- with tm .assert_produces_warning (FutureWarning ) as w :
461
- s .str .replace (pattern , "" )
462
- assert re .match (msg , str (w [0 ].message ))
You can’t perform that action at this time.
0 commit comments