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.Append() was being indirectly invoked with `Append(true, 0)`, 
which is a simple way to dynamically build a ListArray with unknown size. 
However ListViewArray needs the size included in the Append() API. In order for 
ListArray to be convertible to ListViewArray, it also needs the size assigned 
in Append(). 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