[[arrow::export]]
| 29 | |
| 30 | // [[arrow::export]] |
| 31 | std::shared_ptr<arrow::Schema> Schema__from_list(cpp11::list field_list) { |
| 32 | R_xlen_t n = field_list.size(); |
| 33 | |
| 34 | bool nullable = true; |
| 35 | cpp11::strings names(field_list.attr(R_NamesSymbol)); |
| 36 | |
| 37 | std::vector<std::shared_ptr<arrow::Field>> fields(n); |
| 38 | |
| 39 | for (R_xlen_t i = 0; i < n; i++) { |
| 40 | fields[i] = arrow::field( |
| 41 | names[i], cpp11::as_cpp<std::shared_ptr<arrow::DataType>>(field_list[i]), |
| 42 | nullable); |
| 43 | } |
| 44 | return arrow::schema(fields); |
| 45 | } |
| 46 | |
| 47 | // [[arrow::export]] |
| 48 | std::string Schema__ToString(const std::shared_ptr<arrow::Schema>& s) { |
no test coverage detected