Pandas 1.3.0 introduces a bunch of changes and deprecations around how
timestamps are handled. With the change, calling
Timestamp.min.replace() or Timestamp.max.replace() causes out of
pandas._libs.tslibs.np_datetime.OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1677-09-21 00:12:43
This is presumably the same kind of error that this code is trying to
avoid - by converting min and max timestamps to something slightly
inside the true bounds.
It seems that Timestamp.min.replace(tzinfo=None) and
Timestamp.min.tz_localize(None) are semantically equivalent - and as
an added bonus, the latter is more performant and doesn't hit our out of
I believe the risk of this causing issues is low - if I understand the
surrounding code correctly, it only matters when trying to validate
DataFrames that have Timestamps that are very close to the actual
min/max valid Timestamp.