BUG: raise if invalid freq is passed
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Quick follow-up to very small regression in #23503 (see https://github.com/pandas-dev/pandas/pull/23503#discussion_r231513790 )
