romainfrancois commented on a change in pull request #11805:
URL: https://github.com/apache/arrow/pull/11805#discussion_r761738452
##########
File path: r/R/type.R
##########
@@ -387,6 +389,22 @@ decimal <- function(precision, scale) {
Decimal128Type__initialize(precision, scale)
}
+#' @rdname data-type
+#' @export
+decimal256 <- function(precision, scale) {
Review comment:
Perhaps `decimal()` and `decimal256` could call the same function for
argument checking, e.g.
```r
check_decimal_args <- function(precision, scale) {
precision <- vec_cast(precision, to = integer())
vec_assert(precision, size = 1L)
scale <- vec_cast(scale, to = integer())
vec_assert(scale, size = 1L)
list(precision = precision, scale = scale)
}
#' @rdname data-type
#' @export
decimal <- function(precision, scale) {
args <- check_decimal_args(precision, scale)
Decimal128Type__initialize(args$precision, args$scale)
}
#' @rdname data-type
#' @export
decimal256 <- function(precision, scale) {
args <- check_decimal_args(precision, scale)
Decimal256Type__initialize(args$precision, args$scale)
}
```
--
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]