Skip to content

Commit d0675f4

Browse files
author
Robert Schmidtke
committed
attempt failing test
1 parent e5a0df9 commit d0675f4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/tslibs/test_array_to_datetime.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,17 @@ def test_to_datetime_barely_out_of_bounds():
272272
tslib.array_to_datetime(arr)
273273

274274

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+
275286
class SubDatetime(datetime):
276287
pass
277288

0 commit comments

Comments
 (0)