thisisnic commented on code in PR #14062:
URL: https://github.com/apache/arrow/pull/14062#discussion_r964886799
##########
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:
We get the error `Cannot infer type from vector`.
--
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]