CI: fix mypy error
`pandas/core/generic.py:9138: error: Item "None" of "Optional[DateOffset]" has no attribute "rule_code"`

https://github.com/pandas-dev/pandas/runs/333145832


thanks @TomAugspurger fixed it in this one: https://github.com/pandas-dev/pandas/pull/30049 actually i see you are fixing in a  better way, lmk what you want to do here > actually i see you are fixing in a better way, lmk what you want to do here

Tom's fix is good for now.