@@ -10,6 +10,7 @@ from numpy cimport (
1010 int16_t,
1111 int32_t,
1212 int64_t,
13+ intp_t,
1314 ndarray,
1415 uint8_t,
1516 uint16_t,
@@ -31,7 +32,8 @@ def inner_join(const int64_t[:] left, const int64_t[:] right,
3132 Py_ssize_t max_groups ):
3233 cdef:
3334 Py_ssize_t i, j, k, count = 0
34- ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
35+ ndarray[intp_t] left_sorter, right_sorter
36+ ndarray[int64_t] left_count, right_count
3537 ndarray[int64_t] left_indexer, right_indexer
3638 int64_t lc, rc
3739 Py_ssize_t loc, left_pos = 0 , right_pos = 0 , position = 0
@@ -82,8 +84,8 @@ def left_outer_join(const int64_t[:] left, const int64_t[:] right,
8284 Py_ssize_t max_groups , bint sort = True ):
8385 cdef:
8486 Py_ssize_t i, j, k, count = 0
85- ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
86- ndarray rev
87+ ndarray[int64_t] left_count, right_count
88+ ndarray[intp_t] rev, left_sorter, right_sorter
8789 ndarray[int64_t] left_indexer, right_indexer
8890 int64_t lc, rc
8991 Py_ssize_t loc, left_pos = 0 , right_pos = 0 , position = 0
@@ -155,7 +157,8 @@ def full_outer_join(const int64_t[:] left, const int64_t[:] right,
155157 Py_ssize_t max_groups ):
156158 cdef:
157159 Py_ssize_t i, j, k, count = 0
158- ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
160+ ndarray[intp_t] left_sorter, right_sorter
161+ ndarray[int64_t] left_count, right_count
159162 ndarray[int64_t] left_indexer, right_indexer
160163 int64_t lc, rc
161164 int64_t left_pos = 0 , right_pos = 0
@@ -213,12 +216,16 @@ def full_outer_join(const int64_t[:] left, const int64_t[:] right,
213216 _get_result_indexer(right_sorter, right_indexer))
214217
215218
216- cdef _get_result_indexer(ndarray[int64_t] sorter, ndarray[int64_t] indexer):
219+ cdef ndarray[int64_t] _get_result_indexer(
220+ ndarray[intp_t] sorter, ndarray[int64_t] indexer
221+ ):
217222 if len (sorter) > 0 :
218223 # cython-only equivalent to
219224 # `res = algos.take_nd(sorter, indexer, fill_value=-1)`
220225 res = np.empty(len (indexer), dtype = np.int64)
221226 take_1d_int64_int64(sorter, indexer, res, - 1 )
227+ # FIXME: sorter is intp_t, not int64_t, opposite for indexer;
228+ # will this break on 32bit builds?
222229 else :
223230 # length-0 case
224231 res = np.empty(len (indexer), dtype = np.int64)
0 commit comments