ENH: add groupby & reduce support to EA by jreback · Pull Request #22762 · pandas-dev/pandas (original) (raw)
I'm not really sure what's cleanest.
If a class implements just some reductions, changing what we do in the base class doesn't won't make a difference. At that point I think it's up to the EA to raise the correct exception for methods they don't support.
For classes that don't implement any reductions, we could either raise a TypeError, or put each call in a
try:
values._reduce(...)
except NotImplementedError:
raise TypeError(...)
but doing that everywhere seems error prone.