Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Fix bound checking for Timestamp() with dt64 #4065
To fix the bug, this change adds bounds checking to _get_datetime64_nanos() for numpy datetimes that aren't already in [ns] units. Additionally, it updates _check_dts_bounds() to do the bound check just based off the pandas_datetimestruct, by comparing to the minimum and maximum valid pandas_datetimestructs for datetime64[ns]. It is simpler and more accurate than the previous system. Also includes a number of small refactors/fixes to deal with new error cases that didn't exist when invalid datetime64s were just silently coerced into the valid datetime64[ns] range.
- Loading branch information
Showing
9 changed files
with
340 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.