nealrichardson commented on a change in pull request #11176:
URL: https://github.com/apache/arrow/pull/11176#discussion_r712499201
##########
File path: r/src/compute.cpp
##########
@@ -449,6 +449,33 @@ std::shared_ptr<arrow::compute::FunctionOptions>
make_compute_options(
return std::make_shared<Options>(cpp11::as_cpp<int64_t>(options["pivot"]));
}
+ if (func_name == "round") {
+ using Options = arrow::compute::RoundOptions;
+ auto out = std::make_shared<Options>(Options::Defaults());
+ if (!Rf_isNull(options["ndigits"])) {
+ out->ndigits = cpp11::as_cpp<int64_t>(options["ndigits"]);
+ }
+ SEXP round_mode = options["round_mode"];
+ if (!Rf_isNull(round_mode)) {
+ out->round_mode = cpp11::as_cpp<enum
arrow::compute::RoundMode>(round_mode);
+ }
+ return out;
+ }
+
+ if (func_name == "round_to_multiple") {
+ using Options = arrow::compute::RoundToMultipleOptions;
+ auto out = std::make_shared<Options>(Options::Defaults());
+ if (!Rf_isNull(options["multiple"])) {
+ out->multiple = cpp11::as_cpp<double>(options["multiple"]);
+ }
+ SEXP round_mode = options["round_mode"];
+ if (!Rf_isNull(round_mode) && TYPEOF(round_mode) == INTSXP &&
+ XLENGTH(round_mode) == 1) {
Review comment:
same here
```suggestion
if (!Rf_isNull(round_mode)) {
```
--
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]