Skip to content

Commit f7953f2

Browse files
committed
Add validation
1 parent a1d304d commit f7953f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/_libs/tslibs/offsets.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4550,6 +4550,9 @@ cdef class Easter(SingleConstructorOffset):
45504550

45514551
self.method = method
45524552

4553+
if method < 1 or method > 3:
4554+
raise ValueError(f"Method must be 1<=method<=3, got {method}")
4555+
45534556
cpdef __setstate__(self, state):
45544557
self.n = state.pop("n")
45554558
self.normalize = state.pop("normalize")

0 commit comments

Comments
 (0)