File tree 1 file changed +3
-20
lines changed
pandas/_libs/src/ujson/python
1 file changed +3
-20
lines changed Original file line number Diff line number Diff line change @@ -212,36 +212,19 @@ static TypeContext *createTypeContext(void) {
212
212
return pc ;
213
213
}
214
214
215
- static int is_sparse_array (PyObject * obj ) {
216
- // TODO can be removed again once SparseArray.values is removed (GH26421)
217
- if (PyObject_HasAttrString (obj , "_subtyp" )) {
218
- PyObject * _subtype = PyObject_GetAttrString (obj , "_subtyp" );
219
- PyObject * sparse_array = PyUnicode_FromString ("sparse_array" );
220
- int ret = PyUnicode_Compare (_subtype , sparse_array );
221
-
222
- if (ret == 0 ) {
223
- return 1 ;
224
- }
225
- }
226
- return 0 ;
227
- }
228
-
229
215
static PyObject * get_values (PyObject * obj ) {
230
216
PyObject * values = NULL ;
231
217
232
- if (!is_sparse_array (obj )) {
233
- values = PyObject_GetAttrString (obj , "values" );
234
- PRINTMARK ();
235
- }
218
+ values = PyObject_GetAttrString (obj , "values" );
219
+ PRINTMARK ();
236
220
237
221
if (values && !PyArray_CheckExact (values )) {
238
222
239
223
if (PyObject_HasAttrString (values , "to_numpy" )) {
240
224
values = PyObject_CallMethod (values , "to_numpy" , NULL );
241
225
}
242
226
243
- if (!is_sparse_array (values ) &&
244
- PyObject_HasAttrString (values , "values" )) {
227
+ if (PyObject_HasAttrString (values , "values" )) {
245
228
PyObject * subvals = get_values (values );
246
229
PyErr_Clear ();
247
230
PRINTMARK ();
You can’t perform that action at this time.
0 commit comments