BUG: add py39 compat check for ast.slice #32766
- [x] closes #32766
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`


Should this only be done for py39+? does this need a test? > does this need a test?

Not sure about this. Might need other people's opinion. thanks @VirosaLi and thanks for pushing on the 3.9 stuff. note we *might* need to backport this. > thanks @VirosaLi and thanks for pushing on the 3.9 stuff. note we _might_ need to backport this.

You are welcome. Let me know if you need me to backport this.