Skip to content

Commit 4ac5ee2

Browse files
Backport PR pandas-dev#57668 on branch 2.2.x (CLN: More numpy 2 stuff) (pandas-dev#57707)
Backport PR pandas-dev#57668: CLN: More numpy 2 stuff Co-authored-by: Thomas Li <[email protected]>
1 parent 9a07184 commit 4ac5ee2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

pandas/_libs/src/vendored/ujson/python/objToJSON.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ typedef struct __NpyArrContext {
7474
npy_intp ndim;
7575
npy_intp index[NPY_MAXDIMS];
7676
int type_num;
77-
PyArray_GetItemFunc *getitem;
7877

7978
char **rowLabels;
8079
char **columnLabels;
@@ -405,7 +404,6 @@ static void NpyArr_iterBegin(JSOBJ _obj, JSONTypeContext *tc) {
405404
}
406405

407406
npyarr->array = (PyObject *)obj;
408-
npyarr->getitem = (PyArray_GetItemFunc *)PyArray_DESCR(obj)->f->getitem;
409407
npyarr->dataptr = PyArray_DATA(obj);
410408
npyarr->ndim = PyArray_NDIM(obj) - 1;
411409
npyarr->curdim = 0;
@@ -492,7 +490,7 @@ static int NpyArr_iterNextItem(JSOBJ obj, JSONTypeContext *tc) {
492490
((PyObjectEncoder *)tc->encoder)->npyValue = npyarr->dataptr;
493491
((PyObjectEncoder *)tc->encoder)->npyCtxtPassthru = npyarr;
494492
} else {
495-
GET_TC(tc)->itemValue = npyarr->getitem(npyarr->dataptr, npyarr->array);
493+
GET_TC(tc)->itemValue = PyArray_GETITEM(arrayobj, npyarr->dataptr);
496494
}
497495

498496
npyarr->dataptr += npyarr->stride;

0 commit comments

Comments
 (0)