-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLN: Stopped casting values in Series/Index.isin for datelike dtypes #58645
Conversation
pandas/core/arrays/datetimelike.py
Outdated
try: | ||
values = type(self)._from_sequence(values) | ||
except ValueError: | ||
if "mixed" in lib.infer_dtype(values, skipna=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jbrockmendel did you intend to allow the mixed object case? pandas/tests/indexes/test_datetimelike.py::TestDatetimeLike::test_isin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id be OK with deprecating that, but didn't have that in mind with the deprecation here. the deprecation here was aimed at avoiding a try/except on _from_sequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i also suspect we can avoid the "mixed" check and just check for object dtype.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. I added a comment to deprecate in the future.
Also nice find. I was able to avoid the infer_dtype
call
xref #53111