Closed
Description
There's lots of nested logic there (plus 1 more level from #22343). Would be good to simplify this.
The components:
- argument validation (could maybe do this elsewhere, not a big deal)
- astyping to categorical is special cased. We'll want to remove that in favor of a generic astype system
- Determine target_dtype -> Block type
_astype
currently takes avalues
argument, which complicates things. Why is that? Why isn't it justself.values
always?