BUG: Converting pd.Timestamp.min
to equivalent pydatetime object and back raises OutOfBoundsDatetime
#46154
Closed
3 tasks done
Labels
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Going from
pd.Timestamp.min
to the equivalentdatetime.datetime
instance and back works with pandas v1.2.5 but fails in v1.3.0 (and all subsequent versions) due to an out of bounds error. This behavior is unchanged in the current main branch:See traceback for version
1.5.0.dev0+396.geaefc5c416
I'm not sure what to make of the "Discarding nonzero nanoseconds in conversion" warning above the traceback.
I believe this regression was introduced in #39245, which modifies the
_NS_MIN_DTS
const value:Expected Behavior
The script above should print out the datetime as a string. Pandas v1.2.5 does the following:
Installed Versions
Versions for
v1.2.5
Versions for
v1.3.0
Versions for current main branch
The text was updated successfully, but these errors were encountered: