-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: to_timedelta
overflows without raising in some very particular cases
#17037
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
Comments
@cchwala : Weird...I'm inclined to believe there is some machine rounding issues going on, but this certainly merits further investigation. If you can pinpoint the cause, feel free to share and / or submit a PR to patch this behavior! |
@gfyoung : Right now, I have no time to dive into this and fix it, but I could at least provide a test that fails on this bug, probably as PR. This would be a starting point. Or would you rather leave this here as it is, till somebody really wants to tackle the problem? |
@cchwala : We'll just leave it open for now in case anyone wants to tackle it. Thanks for reporting it! |
hmm might be can u check and if so issue a PR with validation tests? |
@jbrockmendel according to your todo list this issue has been fixed. |
@ron819 is the list accurate? Let's be sure to defend against the failure mode of me messing up |
I now get |
Code Sample, a copy-pastable example if possible
Output:
Here is a more detailed notebook showing the problem
Problem description
If you pass floating points values close to the edge of overflow to
to_timedelta
it might return an incorrectTimedelta
instead of raising anOverflowError
.Output of
pd.show_versions()
pandas: 0.20.1
pytest: 3.0.7
pip: 9.0.1
setuptools: 33.1.1.post20170320
Cython: 0.25.2
numpy: 1.12.1
scipy: 0.19.0
xarray: 0.9.5-11-gff2e4dd
IPython: 5.3.0
sphinx: 1.3.5
patsy: 0.4.0
dateutil: 2.5.1
pytz: 2016.2
blosc: None
bottleneck: 1.2.0
tables: 3.2.2
numexpr: 2.6.2
feather: None
matplotlib: 2.0.0
openpyxl: 2.3.2
xlrd: 0.9.4
xlwt: 1.0.0
xlsxwriter: 0.8.4
lxml: 3.6.0
bs4: 4.4.1
html5lib: None
sqlalchemy: 1.0.12
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: 2.8
s3fs: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: