CLN: fix core/algorithms.py dtype detection (original) (raw)

after this is merged: #15299

we have separate if/else detections for pretty much every routines, e.g. things like

if needs_i8_conversion:
    ....
elif .....

This is very smelly and needs to be refactored

#15902 instroduces _ensure_data to do this, but is restricted ATM to nlargest/nsamllest and needs integration.

Note that this is actually a bit tricky, because we actually want to return a bit more data, including a previously localized tz (for re-localization after).