-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: nested construction with timedelta #11129 #11134
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
try making it a |
hmm, no reason ever to do |
@@ -2177,6 +2180,13 @@ cdef class _Timedelta(timedelta): | |||
""" | |||
return timedelta(microseconds=int(self.value)/1000) | |||
|
|||
cdef inline bint _has_ns(_Timedelta td): | |||
""" |
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.
make this a method of _Timedelta
.
self.value % 1000 != 0
(might be same speed)
changing to a
|
lgtm. pls change |
bb93b70
to
68036a9
Compare
68036a9
to
961dd47
Compare
@jreback made that change, Travis green. |
BUG: nested construction with timedelta #11129
thank u sir! |
Closes #11129
Per discussion in issue this adds similar hash equality to
_Timedelta
/datetime.timedelta
that exists for
_Timestamp
/datetime.datime
.I tried inlining
_Timedelta._ensure_components
and it actually hurt performance a bit, so I left itas a plain
def
but did build a seperate_has_ns
check for hashing.Adds a little overhead to hashing: