felipecrv commented on code in PR #40482:
URL: https://github.com/apache/arrow/pull/40482#discussion_r1525636649


##########
python/pyarrow/src/arrow/python/arrow_to_pandas.cc:
##########
@@ -826,6 +830,37 @@ Status ConvertListsLike(PandasOptions options, const 
ChunkedArray& data,
   return Status::OK();
 }
 
+template <class T>
+struct ListViewConversionType;
+
+template <>
+struct ListViewConversionType<ListViewType> {
+  using type = ListType;
+};
+
+template <>
+struct ListViewConversionType<LargeListViewType> {
+  using type = LargeListType;
+};

Review Comment:
   I needed this same type trait in other situations. @bkietz, do you have a 
suggestion on how to have this in `type_traits.h`?
   
   ```cpp
   diff --git a/cpp/src/arrow/type_traits.h b/cpp/src/arrow/type_traits.h
   index ed66c9367d..87c38b03df 100644
   --- a/cpp/src/arrow/type_traits.h
   +++ b/cpp/src/arrow/type_traits.h
   @@ -449,6 +449,7 @@ struct TypeTraits<ListType> {
      using OffsetBuilderType = Int32Builder;
      using OffsetScalarType = Int32Scalar;
      constexpr static bool is_parameter_free = false;
   +  using ListViewType = ListViewType;
      using LargeType = LargeListType;
    };
   
   @@ -462,6 +463,7 @@ struct TypeTraits<LargeListType> {
      using OffsetBuilderType = Int64Builder;
      using OffsetScalarType = Int64Scalar;
      constexpr static bool is_parameter_free = false;
   +  using ListViewType = LargeListViewType;
    };
   
    template <>
   @@ -474,6 +476,7 @@ struct TypeTraits<ListViewType> {
      using OffsetBuilderType = Int32Builder;
      using OffsetScalarType = Int32Scalar;
      constexpr static bool is_parameter_free = false;
   +  using ListType = ListType;
      using LargeType = LargeListViewType;
    };
   
   @@ -487,6 +490,7 @@ struct TypeTraits<LargeListViewType> {
      using OffsetBuilderType = Int64Builder;
      using OffsetScalarType = Int64Scalar;
      constexpr static bool is_parameter_free = false;
   +  using ListType = LargeListType;
    };
    ```



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