ianmcook commented on a change in pull request #9952: URL: https://github.com/apache/arrow/pull/9952#discussion_r610993563
########## File path: r/R/arrow-datum.R ########## @@ -22,6 +22,7 @@ ArrowDatum <- R6Class("ArrowDatum", inherit = ArrowObject, public = list( cast = function(target_type, safe = TRUE, ...) { + target_type <- unmask_type_fun(enexpr(target_type)) %||% target_type Review comment: Re the nullity checks mentioned in the above comment: we can probably get around that problem by using `if (!missing(type))` instead of `if (!is.null(type))` and not giving the `type` argument a default value of `NULL`. This solves two problems: 1- checking `is.null()` on a quosure causes it to evaluate immediately and makes subsequent calls to `enquo()` capture the evaluated value, not the expression. 2- checking `is.null()` on a quosure whose expression evaluates to `NULL` does not return `NULL`. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org