-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Timedelta comparisons with very large pytimedeltas overflowing #51538
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
pandas/_libs/tslibs/timedeltas.pyx
Outdated
elif op == Py_NE: | ||
return True | ||
elif op == Py_LE or op == Py_LT: | ||
return self.days <= other.days |
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.
- Shouldn't we use
<=
orPY_LE
and<
forPy_LT
? - What about the other components?
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.
hmm i wrote this with self.unit == "ns" in mind, in which case if it overflows we really just need to know which direction it overflowed. but with "s"/"ms" this could be subtly wrong. will update w/ tests.
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
updated+green |
Thanks @jbrockmendel |
…rge pytimedeltas overflowing
…ery large pytimedeltas overflowing) (#52241) Backport PR #51538: BUG: Timedelta comparisons with very large pytimedeltas overflowing Co-authored-by: jbrockmendel <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.