REF: avoid getattr pattern in libgroupby rank functions
cc @WillAyd do we need to do anything special w/r/t the comment on L1220 re #19560?
> cc @WillAyd do we need to do anything special w/r/t the comment on L1220 re #19560?

Is this changing behavior when trying to rank objects? I think on master raises an error

```python
>>> pd.DataFrame([[1]], dtype=object).groupby([1]).rank()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/williamayd/clones/pandas/pandas/core/groupby/groupby.py", line 2144, in rank
    axis=axis,
  File "/Users/williamayd/clones/pandas/pandas/core/groupby/groupby.py", line 867, in _cython_transform
    result, _ = self.grouper.transform(obj.values, how, **kwargs)
  File "/Users/williamayd/clones/pandas/pandas/core/groupby/ops.py", line 621, in transform
    return self._cython_operation("transform", values, how, axis, **kwargs)
  File "/Users/williamayd/clones/pandas/pandas/core/groupby/ops.py", line 583, in _cython_operation
    result, values, labels, func, is_numeric, is_datetimelike, **kwargs
  File "/Users/williamayd/clones/pandas/pandas/core/groupby/ops.py", line 658, in _transform
    transform_func(result, values, comp_ids, ngroups, is_datetimelike, **kwargs)
  File "/Users/williamayd/clones/pandas/pandas/core/groupby/ops.py", line 441, in wrapper
    return f(afunc, *args, **kwargs)
  File "/Users/williamayd/clones/pandas/pandas/core/groupby/ops.py", line 393, in <lambda>
    kwargs.get("na_option", "keep"),
TypeError: 'NoneType' object is not callable
```

Though not sure how well tested that is. Ideally would be explicitly disallowed but looks like that PR is still open, so might want to be careful when changing this > Is this changing behavior when trying to rank objects? I think on master raises an error

The same example now raises `pandas.core.base.DataError: No numeric types to aggregate` thanks @jbrockmendel 