jorisvandenbossche commented on code in PR #14238:
URL: https://github.com/apache/arrow/pull/14238#discussion_r980026974
##########
python/pyarrow/src/arrow_to_pandas.cc:
##########
@@ -753,8 +770,17 @@ Status ConvertListsLike(PandasOptions options, const
ChunkedArray& data,
int64_t chunk_offset = 0;
for (int c = 0; c < data.num_chunks(); c++) {
- const auto& arr = checked_cast<const ListArrayT&>(*data.chunk(c));
+ std::shared_ptr<DataType> out_ty;
+ if (lt != nullptr) {
+ out_ty = fixed_size_list(storage_ty, lt->list_size());
+ } else {
+ out_ty = list(storage_ty);
+ }
+ compute::CastOptions options;
+ options.to_type = out_ty;
+ ARROW_ASSIGN_OR_RAISE(std::shared_ptr<Array> casted,
compute::Cast(*data.chunk(c), out_ty, options));
+ const auto& arr = checked_cast<const ListArrayT&>(*casted);
Review Comment:
Not fully sure the conversion is needed here, because I think `arr` is only
used to get the offsets, which should stay the same whether it is uses
extension type or storage type for the values.
--
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]