Skip to content

Commit 07d0488

Browse files
pilkibunjreback
pilkibun
authored andcommitted
CLN: revisit build warnings in cython templates (#27346)
1 parent 40e3c7b commit 07d0488

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

pandas/_libs/groupby_helper.pxi.in

+10-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ def group_last_{{name}}({{c_type}}[:, :] out,
7676
val = values[i, j]
7777

7878
# not nan
79-
if val == val and val != {{nan_val}}:
79+
if (
80+
{{if not name.startswith("int")}}
81+
val == val and
82+
{{endif}}
83+
val != {{nan_val}}):
8084
nobs[lab, j] += 1
8185
resx[lab, j] = val
8286

@@ -133,7 +137,11 @@ def group_nth_{{name}}({{c_type}}[:, :] out,
133137
val = values[i, j]
134138

135139
# not nan
136-
if val == val and val != {{nan_val}}:
140+
if (
141+
{{if not name.startswith("int")}}
142+
val == val and
143+
{{endif}}
144+
val != {{nan_val}}):
137145
nobs[lab, j] += 1
138146
if nobs[lab, j] == rank:
139147
resx[lab, j] = val

pandas/_libs/hashtable_class_helper.pxi.in

+6-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,12 @@ cdef class {{name}}HashTable(HashTable):
424424
for i in range(n):
425425
val = values[i]
426426

427-
if ignore_na and (val != val
428-
or (use_na_value and val == na_value2)):
427+
if ignore_na and (
428+
{{if not name.lower().startswith(("uint", "int"))}}
429+
val != val or
430+
{{endif}}
431+
(use_na_value and val == na_value2)
432+
):
429433
# if missing values do not count as unique values (i.e. if
430434
# ignore_na is True), skip the hashtable entry for them,
431435
# and replace the corresponding label with na_sentinel

0 commit comments

Comments
 (0)