@@ -262,21 +262,6 @@ static Py_ssize_t get_attr_length(PyObject *obj, char *attr) {
262
262
return ret ;
263
263
}
264
264
265
- static int is_simple_frame (PyObject * obj ) {
266
- PyObject * mgr = PyObject_GetAttrString (obj , "_mgr" );
267
- if (!mgr ) {
268
- return 0 ;
269
- }
270
- int ret ;
271
- if (PyObject_HasAttrString (mgr , "blocks" )) {
272
- ret = (get_attr_length (mgr , "blocks" ) <= 1 );
273
- } else {
274
- ret = 0 ;
275
- }
276
-
277
- Py_DECREF (mgr );
278
- return ret ;
279
- }
280
265
281
266
static npy_int64 get_long_attr (PyObject * o , const char * attr ) {
282
267
// NB we are implicitly assuming that o is a Timedelta or Timestamp, or NaT
@@ -1140,15 +1125,8 @@ int DataFrame_iterNext(JSOBJ obj, JSONTypeContext *tc) {
1140
1125
GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "index" );
1141
1126
} else if (index == 2 ) {
1142
1127
memcpy (GET_TC (tc )-> cStr , "data" , sizeof (char ) * 5 );
1143
- if (is_simple_frame (obj )) {
1144
- GET_TC (tc )-> itemValue = PyObject_GetAttrString (obj , "values" );
1145
- if (!GET_TC (tc )-> itemValue ) {
1146
- return 0 ;
1147
- }
1148
- } else {
1149
- Py_INCREF (obj );
1150
- GET_TC (tc )-> itemValue = obj ;
1151
- }
1128
+ Py_INCREF (obj );
1129
+ GET_TC (tc )-> itemValue = obj ;
1152
1130
} else {
1153
1131
return 0 ;
1154
1132
}
@@ -1756,22 +1734,10 @@ void Object_beginTypeContext(JSOBJ _obj, JSONTypeContext *tc) {
1756
1734
return ;
1757
1735
}
1758
1736
1759
- if (is_simple_frame (obj )) {
1760
- pc -> iterBegin = NpyArr_iterBegin ;
1761
- pc -> iterEnd = NpyArr_iterEnd ;
1762
- pc -> iterNext = NpyArr_iterNext ;
1763
- pc -> iterGetName = NpyArr_iterGetName ;
1764
-
1765
- pc -> newObj = PyObject_GetAttrString (obj , "values" );
1766
- if (!pc -> newObj ) {
1767
- goto INVALID ;
1768
- }
1769
- } else {
1770
- pc -> iterBegin = PdBlock_iterBegin ;
1771
- pc -> iterEnd = PdBlock_iterEnd ;
1772
- pc -> iterNext = PdBlock_iterNext ;
1773
- pc -> iterGetName = PdBlock_iterGetName ;
1774
- }
1737
+ pc -> iterBegin = PdBlock_iterBegin ;
1738
+ pc -> iterEnd = PdBlock_iterEnd ;
1739
+ pc -> iterNext = PdBlock_iterNext ;
1740
+ pc -> iterGetName = PdBlock_iterGetName ;
1775
1741
pc -> iterGetValue = NpyArr_iterGetValue ;
1776
1742
1777
1743
if (enc -> outputFormat == VALUES ) {
0 commit comments