-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Use dispatch_to_series where possible #22572
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1638,6 +1638,7 @@ def dispatch_to_series(left, right, func): | |
""" | ||
# Note: we use iloc to access columns for compat with cases | ||
# with non-unique columns. | ||
right = lib.item_from_zerodim(right) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a reason you needed to add this? (e.g. do we actually hit this in the new code path and not in the original)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. This PR has There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok great |
||
if lib.is_scalar(right): | ||
new_data = {i: func(left.iloc[:, i], right) | ||
for i in range(len(left.columns))} | ||
|
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 do we need these assert statements? Are they tested anywhere?
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.
These assertions are always true. I added these so I don't have to keep looking back at core.ops (the only place from which these are called) to double-check what's going on.
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.
So this is just a sanity check really? Perhaps we should comment that then?
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 the assertion is self-explanatory, but if adding a comment makes reviewers happy, there’s no real downside.