BEMServer / bemserver-core

https://bemserver-docs.readthedocs.io/
MIT License
3 stars 3 forks source link

Catch OutOfBoundsDatetime when loading TS data #160

Closed lafrech closed 1 year ago

lafrech commented 1 year ago

Avoids a crash when input data contains datetimes that pandas can't convert into Timestamps.

https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#timestamp-limitations

We should also catch errors when e.g. getting data with bounds that are out of range, because this will fail too. For now, let's leave this to API validation and assume users using core know what they are doing.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change

Comparison is base (93d11d3) 94.95% compared to head (d7dd7eb) 94.95%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #160 +/- ## ======================================= Coverage 94.95% 94.95% ======================================= Files 35 35 Lines 2358 2358 Branches 441 441 ======================================= Hits 2239 2239 Misses 95 95 Partials 24 24 ``` | [Impacted Files](https://codecov.io/gh/BEMServer/bemserver-core/pull/160?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BEMServer) | Coverage Δ | | |---|---|---| | [bemserver\_core/input\_output/timeseries\_data\_io.py](https://codecov.io/gh/BEMServer/bemserver-core/pull/160?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BEMServer#diff-YmVtc2VydmVyX2NvcmUvaW5wdXRfb3V0cHV0L3RpbWVzZXJpZXNfZGF0YV9pby5weQ==) | `97.95% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BEMServer). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BEMServer)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.