-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
REF: Avoid dispatching Series ops to pd.Index #27268
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
Conversation
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.
small comment, otherwise lgtm.
pandas/core/ops/__init__.py
Outdated
orig_right = right | ||
if is_scalar(right): | ||
# broadcast and wrap in a TimedeltaIndex | ||
# TODO: possible perf improvement by using NaTD scalar |
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 don't think this this is a worthwhile comment here as NaTD is not likely to happen
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 think there's a decent chance we'll implement it for internal use to de-duplicate logic like this.
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.
Removed comment
thanks |
We have some semi-circular dispatch logic between non-EA Series and pd.Index ops. This avoids that circularity by implementing the relevant logic directly in the Series implementation. After this I'm going to start migrating the Index implementations to use the Series implementation, after which we will have One True Implementation (also have to migrate RangeIndex and IntegerArray implementations)