romainfrancois edited a comment on pull request #8650:
URL: https://github.com/apache/arrow/pull/8650#issuecomment-787798752


   Which essentially is: 
   
   ``` r
   vctrs::vec_size(structure(list(1), class = c("one")))
   #> Error: Input must be a vector, not a `one` object.
   ```
   
   <sup>Created on 2021-03-01 by the [reprex 
package](https://reprex.tidyverse.org) (v0.3.0)</sup>
   
   as used in the `ListConverter`: 
   
   ```cpp
   template <typename T>
   class RListConverter : public ListConverter<T, RConverter, RConverterTrait> {
    public:
     Status Extend(SEXP x, int64_t size) override {
       RETURN_NOT_OK(this->Reserve(size));
   
       RVectorType rtype = GetVectorType(x);
       if (rtype != LIST) {
         return Status::Invalid("Cannot convert to list type");
       }
   
       auto append_value = [this](SEXP value) {
         auto n = vctrs::short_vec_size(value);    // <---------- HERE
         RETURN_NOT_OK(this->list_builder_->ValidateOverflow(n));
         RETURN_NOT_OK(this->list_builder_->Append());
         return this->value_converter_.get()->Extend(value, n);
       };
       auto append_null = [this]() { return this->list_builder_->AppendNull(); 
};
       return RVectorVisitor<SEXP>::Visit(x, size, append_null, append_value);
     }
   };
   ```
   


----------------------------------------------------------------
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:
[email protected]


Reply via email to