From a36ca29ea0d0e5694638eaba40bf19cf9c1238be Mon Sep 17 00:00:00 2001 From: Samuel GIFFARD Date: Mon, 1 Mar 2021 18:09:34 +0900 Subject: [PATCH] to_offset was not using the compiled regex Resolves #39988. --- pandas/_libs/tslibs/offsets.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 2d4704ad3bda6..4e6e5485b2ade 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -3579,7 +3579,7 @@ cpdef to_offset(freq): stride_sign = None try: - split = re.split(opattern, freq) + split = opattern.split(freq) if split[-1] != "" and not split[-1].isspace(): # the last element must be blank raise ValueError("last element must be blank")