Skip to content

Commit 95d740e

Browse files
author
OlivierLuG
committed
pandas-dev#34621 review taken into account
1 parent ab5640f commit 95d740e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/_libs/tslibs/period.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -2407,11 +2407,11 @@ class Period(_Period):
24072407
value = value.upper()
24082408
dt, reso = parse_time_string(value, freq)
24092409
try:
2410-
ts = Timestamp(value, freq=freq)
2410+
ts = Timestamp(value)
24112411
nanosecond = ts.nanosecond
24122412
if nanosecond != 0:
24132413
reso = 'nanosecond'
2414-
except (ValueError, OutOfBoundsDatetime):
2414+
except ValueError:
24152415
nanosecond = 0
24162416
if dt is NaT:
24172417
ordinal = NPY_NAT
@@ -2498,7 +2498,7 @@ def quarter_to_myear(year: int, quarter: int, freq):
24982498
mnum = c_MONTH_NUMBERS[get_rule_month(freq)] + 1
24992499
month = (mnum + (quarter - 1) * 3) % 12 + 1
25002500
if month > mnum:
2501-
year -= 1
2501+
year -= 1ough to only use ValueError, as that would already cover the OutOfBoundsDatet
25022502

25032503
return year, month
25042504
# TODO: This whole func is really similar to parsing.pyx L434-L450

0 commit comments

Comments
 (0)