| 584 | } |
| 585 | |
| 586 | std::shared_ptr<arrow::compute::CastOptions> make_cast_options(cpp11::list options) { |
| 587 | using Options = arrow::compute::CastOptions; |
| 588 | auto out = std::make_shared<Options>(true); |
| 589 | SEXP to_type = options["to_type"]; |
| 590 | if (!Rf_isNull(to_type) && cpp11::as_cpp<std::shared_ptr<arrow::DataType>>(to_type)) { |
| 591 | out->to_type = cpp11::as_cpp<std::shared_ptr<arrow::DataType>>(to_type); |
| 592 | } |
| 593 | |
| 594 | SEXP allow_float_truncate = options["allow_float_truncate"]; |
| 595 | if (!Rf_isNull(allow_float_truncate) && cpp11::as_cpp<bool>(allow_float_truncate)) { |
| 596 | out->allow_float_truncate = cpp11::as_cpp<bool>(allow_float_truncate); |
| 597 | } |
| 598 | |
| 599 | SEXP allow_time_truncate = options["allow_time_truncate"]; |
| 600 | if (!Rf_isNull(allow_time_truncate) && cpp11::as_cpp<bool>(allow_time_truncate)) { |
| 601 | out->allow_time_truncate = cpp11::as_cpp<bool>(allow_time_truncate); |
| 602 | } |
| 603 | |
| 604 | SEXP allow_int_overflow = options["allow_int_overflow"]; |
| 605 | if (!Rf_isNull(allow_int_overflow) && cpp11::as_cpp<bool>(allow_int_overflow)) { |
| 606 | out->allow_int_overflow = cpp11::as_cpp<bool>(allow_int_overflow); |
| 607 | } |
| 608 | return out; |
| 609 | } |
| 610 | |
| 611 | // [[arrow::export]] |
| 612 | SEXP compute__CallFunction(std::string func_name, cpp11::list args, cpp11::list options) { |
no outgoing calls
no test coverage detected