-
-
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22572 +/- ##
==========================================
+ Coverage 92.04% 92.04% +<.01%
==========================================
Files 169 169
Lines 50787 50787
==========================================
+ Hits 46745 46746 +1
+ Misses 4042 4041 -1
Continue to review full report at Codecov.
|
|
||
def _combine_match_index(self, other, func, level=None): | ||
left, right = self.align(other, join='outer', axis=0, level=level, | ||
copy=False) | ||
assert left.index.equals(right.index) |
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.
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This PR has DataFrame._combine_const
send zero-dim arrays down this path, which without this line don't get handled correctly.
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 great
* master: DOC: Update link and description of the Spyder IDE in Ecosystem docs (pandas-dev#22136) BUG: resample with TimedeltaIndex, fenceposts are off (pandas-dev#22488) Use dispatch_to_series where possible (pandas-dev#22572) BLD: Fix openpyxl to 2.5.5 (pandas-dev#22601)
Broken off from #22534, since that ended up surfacing a bug elsewhere.