@@ -33,7 +33,8 @@ def inner_join(const intp_t[:] left, const intp_t[:] right,
33
33
Py_ssize_t max_groups ):
34
34
cdef:
35
35
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
37
38
ndarray[int64_t] left_indexer, right_indexer
38
39
int64_t lc, rc
39
40
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,
84
85
Py_ssize_t max_groups , bint sort = True ):
85
86
cdef:
86
87
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
89
90
ndarray[int64_t] left_indexer, right_indexer
90
91
int64_t lc, rc
91
92
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,
157
158
Py_ssize_t max_groups ):
158
159
cdef:
159
160
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
161
163
ndarray[int64_t] left_indexer, right_indexer
162
164
int64_t lc, rc
163
165
int64_t left_pos = 0 , right_pos = 0
@@ -215,12 +217,16 @@ def full_outer_join(const intp_t[:] left, const intp_t[:] right,
215
217
_get_result_indexer(right_sorter, right_indexer))
216
218
217
219
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
+ ):
219
223
if len (sorter) > 0 :
220
224
# cython-only equivalent to
221
225
# `res = algos.take_nd(sorter, indexer, fill_value=-1)`
222
226
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?
224
230
else :
225
231
# length-0 case
226
232
res = np.empty(len (indexer), dtype = np.int64)
0 commit comments