@@ -33,7 +33,8 @@ def inner_join(const intp_t[:] left, const intp_t[:] right,
3333 Py_ssize_t max_groups ):
3434 cdef:
3535 Py_ssize_t i, j, k, count = 0
36- ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
36+ ndarray[intp_t] left_sorter, right_sorter
37+ ndarray[int64_t] left_count, right_count
3738 ndarray[int64_t] left_indexer, right_indexer
3839 int64_t lc, rc
3940 Py_ssize_t loc, left_pos = 0 , right_pos = 0 , position = 0
@@ -84,8 +85,8 @@ def left_outer_join(const intp_t[:] left, const intp_t[:] right,
8485 Py_ssize_t max_groups , bint sort = True ):
8586 cdef:
8687 Py_ssize_t i, j, k, count = 0
87- ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
88- ndarray rev
88+ ndarray[int64_t] left_count, right_count
89+ ndarray[intp_t] rev, left_sorter, right_sorter
8990 ndarray[int64_t] left_indexer, right_indexer
9091 int64_t lc, rc
9192 Py_ssize_t loc, left_pos = 0 , right_pos = 0 , position = 0
@@ -157,7 +158,8 @@ def full_outer_join(const intp_t[:] left, const intp_t[:] right,
157158 Py_ssize_t max_groups ):
158159 cdef:
159160 Py_ssize_t i, j, k, count = 0
160- ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
161+ ndarray[intp_t] left_sorter, right_sorter
162+ ndarray[int64_t] left_count, right_count
161163 ndarray[int64_t] left_indexer, right_indexer
162164 int64_t lc, rc
163165 int64_t left_pos = 0 , right_pos = 0
@@ -215,12 +217,16 @@ def full_outer_join(const intp_t[:] left, const intp_t[:] right,
215217 _get_result_indexer(right_sorter, right_indexer))
216218
217219
218- cdef _get_result_indexer(ndarray[int64_t] sorter, ndarray[int64_t] indexer):
220+ cdef ndarray[int64_t] _get_result_indexer(
221+ ndarray[intp_t] sorter, ndarray[int64_t] indexer
222+ ):
219223 if len (sorter) > 0 :
220224 # cython-only equivalent to
221225 # `res = algos.take_nd(sorter, indexer, fill_value=-1)`
222226 res = np.empty(len (indexer), dtype = np.int64)
223- take_1d_int64_int64(sorter, indexer, res, - 1 )
227+ take_1d_int64_int64(ensure_int64(sorter), ensure_platform_int(indexer), res, - 1 )
228+ # FIXME: sorter is intp_t, not int64_t, opposite for indexer;
229+ # will this break on 32bit builds?
224230 else :
225231 # length-0 case
226232 res = np.empty(len (indexer), dtype = np.int64)
0 commit comments