Skip to content

Commit 8e5ba59

Browse files
ShaharNavehjbrockmendel
authored andcommitted
BLD: Suppressing errors while compling pandas/_libs/groupby (pandas-dev#32794)
1 parent 23ac98a commit 8e5ba59

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

pandas/_libs/groupby.pyx

+12-4
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,9 @@ def group_last(rank_t[:, :] out,
869869

870870
assert min_count == -1, "'min_count' only used in add and prod"
871871

872-
if not len(values) == len(labels):
872+
# TODO(cython 3.0):
873+
# Instead of `labels.shape[0]` use `len(labels)`
874+
if not len(values) == labels.shape[0]:
873875
raise AssertionError("len(index) != len(labels)")
874876

875877
nobs = np.zeros((<object>out).shape, dtype=np.int64)
@@ -960,7 +962,9 @@ def group_nth(rank_t[:, :] out,
960962

961963
assert min_count == -1, "'min_count' only used in add and prod"
962964

963-
if not len(values) == len(labels):
965+
# TODO(cython 3.0):
966+
# Instead of `labels.shape[0]` use `len(labels)`
967+
if not len(values) == labels.shape[0]:
964968
raise AssertionError("len(index) != len(labels)")
965969

966970
nobs = np.zeros((<object>out).shape, dtype=np.int64)
@@ -1254,7 +1258,9 @@ def group_max(groupby_t[:, :] out,
12541258

12551259
assert min_count == -1, "'min_count' only used in add and prod"
12561260

1257-
if not len(values) == len(labels):
1261+
# TODO(cython 3.0):
1262+
# Instead of `labels.shape[0]` use `len(labels)`
1263+
if not len(values) == labels.shape[0]:
12581264
raise AssertionError("len(index) != len(labels)")
12591265

12601266
nobs = np.zeros((<object>out).shape, dtype=np.int64)
@@ -1327,7 +1333,9 @@ def group_min(groupby_t[:, :] out,
13271333

13281334
assert min_count == -1, "'min_count' only used in add and prod"
13291335

1330-
if not len(values) == len(labels):
1336+
# TODO(cython 3.0):
1337+
# Instead of `labels.shape[0]` use `len(labels)`
1338+
if not len(values) == labels.shape[0]:
13311339
raise AssertionError("len(index) != len(labels)")
13321340

13331341
nobs = np.zeros((<object>out).shape, dtype=np.int64)

0 commit comments

Comments
 (0)