BUG: isin incorrectly casting ints to datetimes by jbrockmendel · Pull Request #37528 · pandas-dev/pandas (original) (raw)

There are a bunch of GH issues about isin (added a new label yesterday), many of which are about unwanted casting. I haven't looked at them all closely tet.

why can't you fix it in _ensure_data then

Even if we fix that (which yes, i'll take a look, but probably in a separate PR), we still need to dispatch to the (Period|Timedelta|Datetime)Index to get correct casting of the other (assuming we want algos.isin(dtlike, other) to match dtlike.isin(other), which I for one do)

am not averse to dispatching to the EA itself, which is what we are already doing for Categorical, or is that the plan

ATM Categorical has isin but thats it. #20617 suggests adding isin to EA, but thats definitely outside the scope of this PR.