diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index c23bccdea3a8a..df3a2e3ecde48 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -4616,7 +4616,28 @@ _lite_rule_alias = { "ns": "ns", } -_dont_uppercase = {"h", "bh", "cbh", "MS", "ms", "s", "me", "qe"} +_dont_uppercase = { + "h", + "bh", + "cbh", + "MS", + "ms", + "s", + "me", + "qe", + "qe-dec", + "qe-jan", + "qe-feb", + "qe-mar", + "qe-apr", + "qe-may", + "qe-jun", + "qe-jul", + "qe-aug", + "qe-sep", + "qe-oct", + "qe-nov", +} INVALID_FREQ_ERR_MSG = "Invalid frequency: {0}" @@ -4635,7 +4656,7 @@ def _get_offset(name: str) -> BaseOffset: -------- _get_offset('EOM') --> BMonthEnd(1) """ - if name not in _dont_uppercase: + if name.lower() not in _dont_uppercase: name = name.upper() name = _lite_rule_alias.get(name, name) name = _lite_rule_alias.get(name.lower(), name) diff --git a/pandas/tests/resample/test_period_index.py b/pandas/tests/resample/test_period_index.py index e768d9266ab89..f4032c1257cf7 100644 --- a/pandas/tests/resample/test_period_index.py +++ b/pandas/tests/resample/test_period_index.py @@ -134,7 +134,7 @@ def test_basic_downsample(self, simple_period_range_series): "rule,expected_error_msg", [ ("y-dec", ""), - ("qe-mar", ""), + ("Q-MAR", ""), ("M", ""), ("w-thu", ""), ],