westonpace commented on a change in pull request #9626:
URL: https://github.com/apache/arrow/pull/9626#discussion_r588143075



##########
File path: cpp/src/arrow/python/arrow_to_pandas.cc
##########
@@ -689,7 +691,8 @@ Status ConvertStruct(PandasOptions options, const 
ChunkedArray& data,
           auto name = array_type->field(static_cast<int>(field_idx))->name();
           if (!arr->field(static_cast<int>(field_idx))->IsNull(i)) {
             // Value exists in child array, obtain it
-            auto array = 
reinterpret_cast<PyArrayObject*>(fields_data[field_idx].obj());
+            auto array = reinterpret_cast<PyArrayObject*>(
+                fields_data[field_idx + fields_data_offset].obj());

Review comment:
       No, it wasn't giving the wrong results.  I don't truly understand it 
myself.  I did modify the test to have unequal chunks however as it can't hurt 
to check that as well.
   
   My best guess is that the later call to `PyArray_GETITEM` is returning some 
`(value, shared_ptr)` pair structure and storing that into the dictionary and 
the later reassignment is modifying the `shared_ptr` but not the `value`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to