@@ -10,6 +10,7 @@ from numpy cimport (
10
10
int16_t,
11
11
int32_t,
12
12
int64_t,
13
+ intp_t,
13
14
ndarray,
14
15
uint8_t,
15
16
uint16_t,
@@ -31,7 +32,8 @@ def inner_join(const int64_t[:] left, const int64_t[:] right,
31
32
Py_ssize_t max_groups ):
32
33
cdef:
33
34
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
35
37
ndarray[int64_t] left_indexer, right_indexer
36
38
int64_t lc, rc
37
39
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,
82
84
Py_ssize_t max_groups , bint sort = True ):
83
85
cdef:
84
86
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
87
89
ndarray[int64_t] left_indexer, right_indexer
88
90
int64_t lc, rc
89
91
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,
155
157
Py_ssize_t max_groups ):
156
158
cdef:
157
159
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
159
162
ndarray[int64_t] left_indexer, right_indexer
160
163
int64_t lc, rc
161
164
int64_t left_pos = 0 , right_pos = 0
@@ -213,12 +216,16 @@ def full_outer_join(const int64_t[:] left, const int64_t[:] right,
213
216
_get_result_indexer(right_sorter, right_indexer))
214
217
215
218
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
+ ):
217
222
if len (sorter) > 0 :
218
223
# cython-only equivalent to
219
224
# `res = algos.take_nd(sorter, indexer, fill_value=-1)`
220
225
res = np.empty(len (indexer), dtype = np.int64)
221
226
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?
222
229
else :
223
230
# length-0 case
224
231
res = np.empty(len (indexer), dtype = np.int64)
0 commit comments