Rank categorical
check for categorical, and then pass the underlying integer codes.

 - [ ] closes #15420
 - [ ] tests added / passed
 - [ ] passes ``git diff upstream/master | flake8 --diff``
 - [ ] whatsnew entry
