-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: DatetimeIndex.get_indexer with mismatched tz #39332
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
PERF: DatetimeIndex.get_indexer with mismatched tz #39332
Conversation
@@ -5178,7 +5178,16 @@ def _maybe_promote(self, other: Index): | |||
if we can upcast the object-dtype one to improve performance. | |||
""" | |||
|
|||
if self.inferred_type == "date" and isinstance(other, ABCDatetimeIndex): | |||
if isinstance(self, ABCDatetimeIndex) and isinstance(other, ABCDatetimeIndex): |
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.
why should this not raise?
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.
This is relevant in three places: get_indexer, get_indexer_non_unique, and join. In the first two, we're talking about comparisons, which always allow mixed tz. In the third, that is just The Way It Is, xref #39328
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.
ok i see, yeah generally i find this weird that we allow indexing on mixed tz's but i guess that boat has sailed.
do we have any asv's on user facing, e.g. loc with mixed tz's? |
i dont think so, this implements one that directly measures get_indexer, with a comment that it reached via |
1 similar comment
i dont think so, this implements one that directly measures get_indexer, with a comment that it reached via |
thanks |
Avoid casting to object dtype.