Skip to content

Commit b1a66f6

Browse files
author
MarcoGorelli
committed
:move: valuerror -> notimplementederror
1 parent 79900d0 commit b1a66f6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pandas/_libs/tslibs/timestamps.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1412,12 +1412,12 @@ class Timestamp(_Timestamp):
14121412
try:
14131413
return self.to_pydatetime().strftime(format)
14141414
except ValueError as err:
1415-
raise ValueError(
1415+
raise NotImplementedError(
14161416
"strftime not yet supported on Timestamps which "
14171417
"are outside the range of Python's standard library. "
14181418
"For now, please call the components you need (such as `.year` "
14191419
"and `.month`) and construct your string from there."
1420-
)
1420+
) from err
14211421

14221422
# Issue 25016.
14231423
@classmethod

pandas/tests/scalar/timestamp/test_timestamp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1114,5 +1114,5 @@ def test_negative_dates():
11141114
"Python's standard library. For now, please call the components you need "
11151115
r"\(such as `.year` and `.month`\) and construct your string from there.$"
11161116
)
1117-
with pytest.raises(ValueError, match=msg):
1117+
with pytest.raises(NotImplementedError, match=msg):
11181118
ts.strftime("%Y")

0 commit comments

Comments
 (0)