ENH: retain masked EA dtypes in groupby with as_index=False by jbrockmendel · Pull Request #41373 · pandas-dev/pandas (original) (raw)

Question: it's certainly nice to already preserve the dtype with as_index=False, but is it worth adding special code for it now if supporting EAs in the Index will also solve it? (assuming it does)

Good question. Better to think of this as a disentangling/refactor of BaseGrouper/Grouping with a bonus upside of fixing the broken cases (in fact, #41529 does most of this except for fixing the as_index cases). If/when we get the general EA Index , we'll be able to come back and trim this down some more.