ianmcook commented on a change in pull request #9952:
URL: https://github.com/apache/arrow/pull/9952#discussion_r610216317



##########
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:
       P.S. my rationale for adding this masking-prevention code is that there 
are more than two dozen data type functions in the arrow package, and they are 
named very generically, so they represent a large surface area for potential 
masking problems, which are likely to occur in user environments, not in our 
CI. If these masking errors do occur, they will probably give frustratingly 
unhelpful error messages. This happened to me with `rlang::string()` as I was 
working on this PR. The error was
   >Error in is_integerish(x) : argument "x" is missing, with no default
   
   which confused the heck out of me for a couple minutes. I think the addition 
of this code should prevent the majority of such masking errors.




-- 
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:
[email protected]


Reply via email to