Skip to content

Commit 61e3fd0

Browse files
authored
MAINT: Initialize year to silence warning (#35763)
Initialize year to silence warning due to subtracting from value that compiler cannot reason must be either initialized or never reached closes #35622
1 parent 9b54f9d commit 61e3fd0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/_libs/tslibs/parsing.pyx

+2-1
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ cdef inline object _parse_dateabbr_string(object date_string, datetime default,
381381
object freq):
382382
cdef:
383383
object ret
384-
int year, quarter = -1, month, mnum, date_len
384+
# year initialized to prevent compiler warnings
385+
int year = -1, quarter = -1, month, mnum, date_len
385386

386387
# special handling for possibilities eg, 2Q2005, 2Q05, 2005Q1, 05Q1
387388
assert isinstance(date_string, str)

0 commit comments

Comments
 (0)