@@ -237,21 +237,6 @@ static PyObject *get_values(PyObject *obj) {
237
237
}
238
238
}
239
239
240
- if ((values == NULL ) && PyObject_HasAttrString (obj , "get_block_values_for_json" )) {
241
- PRINTMARK ();
242
- values = PyObject_CallMethod (obj , "get_block_values_for_json" , NULL );
243
-
244
- if (values == NULL ) {
245
- // Clear so we can subsequently try another method
246
- PyErr_Clear ();
247
- } else if (!PyArray_CheckExact (values )) {
248
- // Didn't get a numpy array, so keep trying
249
- PRINTMARK ();
250
- Py_DECREF (values );
251
- values = NULL ;
252
- }
253
- }
254
-
255
240
if (values == NULL ) {
256
241
PyObject * typeRepr = PyObject_Repr ((PyObject * )Py_TYPE (obj ));
257
242
PyObject * repr ;
@@ -780,7 +765,7 @@ void PdBlock_iterBegin(JSOBJ _obj, JSONTypeContext *tc) {
780
765
goto BLKRET ;
781
766
}
782
767
783
- tmp = get_values (block );
768
+ tmp = PyObject_CallMethod (block , "get_block_values_for_json" , NULL );
784
769
if (!tmp ) {
785
770
((JSONObjectEncoder * )tc -> encoder )-> errorMsg = "" ;
786
771
Py_DECREF (block );
@@ -1266,7 +1251,7 @@ int DataFrame_iterNext(JSOBJ obj, JSONTypeContext *tc) {
1266
1251
} else if (index == 2 ) {
1267
1252
memcpy (GET_TC (tc )-> cStr , "data" , sizeof (char ) * 5 );
1268
1253
if (is_simple_frame (obj )) {
1269
- GET_TC (tc )-> itemValue = get_values (obj );
1254
+ GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "values" );
1270
1255
if (!GET_TC (tc )-> itemValue ) {
1271
1256
return 0 ;
1272
1257
}
@@ -1935,7 +1920,7 @@ void Object_beginTypeContext(JSOBJ _obj, JSONTypeContext *tc) {
1935
1920
pc -> iterNext = NpyArr_iterNext ;
1936
1921
pc -> iterGetName = NpyArr_iterGetName ;
1937
1922
1938
- pc -> newObj = get_values (obj );
1923
+ pc -> newObj = PyObject_GetAttrString (obj , "values" );
1939
1924
if (!pc -> newObj ) {
1940
1925
goto INVALID ;
1941
1926
}
0 commit comments