Skip to content

Commit 087425f

Browse files
author
Sylvain MARIE
committed
Attempt to fix cython related uninitialized variable "quarter" warning
1 parent e2e2d70 commit 087425f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pandas/_libs/tslibs/period.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,9 @@ cdef str _period_strftime(int64_t value, int freq, bytes fmt):
13101310
if found_pat[0] or found_pat[1] or found_pat[2]:
13111311
# get the quarter and modify the year in-place (fiscal?)
13121312
quarter = get_yq(value, freq, &dts)
1313+
else:
1314+
# initialize it still, otherwise generated c code has an error
1315+
quarter = 0
13131316

13141317
for i in range(len(extra_fmts)):
13151318
if found_pat[i]:

0 commit comments

Comments
 (0)