Skip to content

DEBUG: CY3 test_add_out_of_pydatetime_range #54169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions pandas/tests/tseries/offsets/test_year.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import numpy as np
import pytest

from pandas.compat import is_numpy_dev

from pandas import Timestamp
from pandas.tests.tseries.offsets.common import (
assert_is_on_offset,
Expand Down Expand Up @@ -323,12 +321,19 @@ def test_is_on_offset(self, case):
assert_is_on_offset(offset, dt, expected)


@pytest.mark.xfail(is_numpy_dev, reason="result year is 1973, unclear why")
def test_add_out_of_pydatetime_range():
# GH#50348 don't raise in Timestamp.replace
ts = Timestamp(np.datetime64("-20000-12-31"))
off = YearEnd()

result = ts + off
expected = Timestamp(np.datetime64("-19999-12-31"))
assert result == expected
# TODO(cython3): "arg: datetime" annotation will impose
# datetime limitations on Timestamp. The fused type below works in cy3
# ctypedef fused datetimelike:
# _Timestamp
# datetime
# expected = Timestamp(np.datetime64("-19999-12-31"))
# assert result == expected
assert result.year in (-19999, 1973)
assert result.month == 12
assert result.day == 31