danepitkin commented on code in PR #40160:
URL: https://github.com/apache/arrow/pull/40160#discussion_r1496199789


##########
python/pyarrow/src/arrow/python/python_to_arrow.cc:
##########
@@ -824,6 +824,18 @@ class PyListConverter : public ListConverter<T, 
PyConverter, PyConverterTrait> {
   }
 
  protected:
+  Status AppendTo(const MapType*, int64_t size) {
+    return this->list_builder_->Append();
+  }
+
+  Status AppendTo(const FixedSizeListType*, int64_t size) {
+    return this->list_builder_->Append();
+  }
+
+  Status AppendTo(const BaseListType*, int64_t size) {
+    return this->list_builder_->Append(true, size);

Review Comment:
   ListArray was being indirectly initialized with `Append(true, 0)`, which is 
a simple way to dynamically build a ListArray with unknown size. However 
ListViewArray needs the size instantiated upfront. In order for ListArray to be 
convertible to ListViewArray, it also needs the size assigned at instantiation. 
That change is included here for ListArray and ListViewArray (MapArray and 
FixedSizeListArray don't support a parameterized Append() method). See this 
comment for more details: 
https://github.com/apache/arrow/blob/47f15b07080d62cd912bfbfd5d067cf70dfe6960/cpp/src/arrow/array/builder_nested.h#L105



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to