Skip to content

Commit 7e1fab9

Browse files
Initialize variables in pqyear, pquarter (#34409)
Closes #34114
1 parent c382a19 commit 7e1fab9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/_libs/tslibs/period.pyx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1281,14 +1281,16 @@ cdef int pyear(int64_t ordinal, int freq):
12811281
@cython.cdivision
12821282
cdef int pqyear(int64_t ordinal, int freq):
12831283
cdef:
1284-
int year, quarter
1284+
int year = 0
1285+
int quarter = 0
12851286
get_yq(ordinal, freq, &quarter, &year)
12861287
return year
12871288

12881289

12891290
cdef int pquarter(int64_t ordinal, int freq):
12901291
cdef:
1291-
int year, quarter
1292+
int year = 0
1293+
int quarter = 0
12921294
get_yq(ordinal, freq, &quarter, &year)
12931295
return quarter
12941296

0 commit comments

Comments
 (0)