File tree Expand file tree Collapse file tree 3 files changed +256
-175
lines changed Expand file tree Collapse file tree 3 files changed +256
-175
lines changed Original file line number Diff line number Diff line change @@ -1354,7 +1354,7 @@ def replace(
13541354 )
13551355 if len (pat ) == 1 :
13561356 msg += (
1357- " In addition, single character regular expressions will"
1357+ " In addition, single character regular expressions will "
13581358 "*not* be treated as literal strings when regex=True."
13591359 )
13601360 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):
449449 result = s .replace ({regex : "z" }, regex = True )
450450 expected = pd .Series (["z" , "b" , "c" ])
451451 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