Skip to content

Commit b65a9f2

Browse files
committed
fix tests
1 parent 6b417e7 commit b65a9f2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/core/algorithms.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@ def f(c, v):
576576
if (
577577
values.dtype.kind in "iu"
578578
and comps_array.dtype.kind in "iu"
579+
# Only apply fast-path for 64-bit integer widths to avoid
580+
# surprising behaviour on platforms or dtypes with different
581+
# itemsize (see GH discussions). Narrowing to 8-byte ints
582+
# keeps the fast-path safe and performant for the common case.
583+
and values.dtype.itemsize == 8
584+
and comps_array.dtype.itemsize == 8
579585
and not is_dtype_equal(values.dtype, comps_array.dtype)
580586
):
581587
try:

0 commit comments

Comments
 (0)