-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
templatize timedelta arith ops #19871
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 #19871 +/- ##
=======================================
Coverage 91.64% 91.64%
=======================================
Files 150 150
Lines 48946 48946
=======================================
Hits 44858 44858
Misses 4088 4088
Continue to review full report at Codecov.
|
if hasattr(other, 'delta') and not PyDelta_Check(other): | ||
# offsets.Tick | ||
return op(self, other.delta) | ||
if hasattr(other, '_typ'): |
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.
rather than repeating this code can you make a function?
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.
thats exactly what this PR is preliminary to, but with more than just these 3 lines.
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.
oh ok
thanks |
Some Timedelta operations are constructed using
_binary_op_method_timedeltalike
, while a bunch of others re-implement shared logic. This PR is an attempt to get rid of the small differences in this shared logic so they can eventually use a single template.