romainfrancois commented on a change in pull request #7435: URL: https://github.com/apache/arrow/pull/7435#discussion_r443386121
########## File path: r/src/array_from_vector.cpp ########## @@ -201,6 +202,67 @@ struct VectorToArrayConverter { return Status::OK(); } + template <typename T> + arrow::enable_if_t<is_struct_type<T>::value, Status> Visit(const T& type) { + using BuilderType = typename TypeTraits<T>::BuilderType; + ARROW_RETURN_IF(!Rf_inherits(x, "data.frame"), + Status::RError("Expecting a data frame")); + + auto* struct_builder = checked_cast<BuilderType*>(builder); + + int64_t n = vctrs::short_vec_size(x); Review comment: `vctrs::short_vec_size()` knows how to get the size of things like data frames with 0 columns, data frames with data frame columns ... ---------------------------------------------------------------- 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