thisisnic commented on code in PR #14062:
URL: https://github.com/apache/arrow/pull/14062#discussion_r964890117


##########
r/src/type_infer.cpp:
##########
@@ -165,8 +165,13 @@ std::shared_ptr<arrow::DataType> 
InferArrowTypeFromVector<VECSXP>(SEXP x) {
         cpp11::stop(
             "Requires at least one element to infer the values' type of a list 
vector");
       }
-
-      ptype = VECTOR_ELT(x, 0);
+      // Iterate through the vector until we get a non-null result
+      for (R_xlen_t i = 0; i < XLENGTH(x); i++) {
+        ptype = VECTOR_ELT(x, i);
+        if (!Rf_isNull(ptype)) {

Review Comment:
   I guess we actually want the Null type there...



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to