Skip to content
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

Merged
merged 6 commits into from May 17, 2024

Conversation

mroeschke
Copy link
Member

xref #53111

try:
values = type(self)._from_sequence(values)
except ValueError:
if "mixed" in lib.infer_dtype(values, skipna=False):
Copy link
Member Author

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

Copy link
Member

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.

Copy link
Member

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.

Copy link
Member Author

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

@mroeschke mroeschke added this to the 3.0 milestone May 8, 2024
@mroeschke mroeschke merged commit 810fe4f into pandas-dev:main May 17, 2024
47 checks passed
@mroeschke mroeschke deleted the cln/isin/datelike branch May 17, 2024 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants