Skip to content

Commit

Permalink
attempt failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Schmidtke committed Feb 16, 2024
1 parent e5a0df9 commit d0675f4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pandas/tests/tslibs/test_array_to_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,17 @@ def test_to_datetime_barely_out_of_bounds():
tslib.array_to_datetime(arr)


def test_to_datetime_barely_inside_bounds():
# see gh-57150
#
# Close enough to bounds that scaling micros to nanos overflows
# but adding nanos would result in an in-bounds datetime.
arr = np.array(["1677-09-21T00:12:43.145224193"], dtype=object)
result, _ = tslib.array_to_datetime(arr)
expected = ["1677-09-21T00:12:43.145224193"]
tm.assert_numpy_array_equal(result, np.array(expected, dtype="M8[ns]"))


class SubDatetime(datetime):
pass

Expand Down

0 comments on commit d0675f4

Please sign in to comment.