We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5a0df9 commit d0675f4Copy full SHA for d0675f4
pandas/tests/tslibs/test_array_to_datetime.py
@@ -272,6 +272,17 @@ def test_to_datetime_barely_out_of_bounds():
272
tslib.array_to_datetime(arr)
273
274
275
+def test_to_datetime_barely_inside_bounds():
276
+ # see gh-57150
277
+ #
278
+ # Close enough to bounds that scaling micros to nanos overflows
279
+ # but adding nanos would result in an in-bounds datetime.
280
+ arr = np.array(["1677-09-21T00:12:43.145224193"], dtype=object)
281
+ result, _ = tslib.array_to_datetime(arr)
282
+ expected = ["1677-09-21T00:12:43.145224193"]
283
+ tm.assert_numpy_array_equal(result, np.array(expected, dtype="M8[ns]"))
284
+
285
286
class SubDatetime(datetime):
287
pass
288
0 commit comments