jonkeane commented on a change in pull request #10601:
URL: https://github.com/apache/arrow/pull/10601#discussion_r658850721
##########
File path: r/src/type_infer.cpp
##########
@@ -133,8 +133,14 @@ static inline std::shared_ptr<arrow::DataType>
InferArrowTypeFromDataFrame(
template <>
std::shared_ptr<arrow::DataType> InferArrowTypeFromVector<VECSXP>(SEXP x) {
+ SEXP names = Rf_getAttrib(x, R_NamesSymbol);
if (Rf_inherits(x, "data.frame") || Rf_inherits(x, "POSIXlt")) {
return InferArrowTypeFromDataFrame(x);
+ } else if (!Rf_isNull(names)) {
+ // is there some more restrictive way to catch named lists? I've also tried
+ // adding Rf_inherits(x, "list") && !Rf_isNull(names), but that does not
catch
+ // them for some reason.
+ return InferArrowTypeFromDataFrame(x);
Review comment:
I tried a few things here but none of them ended up working out — I'm
sure that I'm missing something obvious
--
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]