You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/04/06 02:34:14 UTC

[GitHub] [arrow] ianmcook commented on a change in pull request #9899: ARROW-11478: [R] Consider ways to make arrow.skip_nul option more user-friendly

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



##########
File path: r/R/util.R
##########
@@ -86,3 +86,11 @@ all_names <- function(expr) {
 is_constant <- function(expr) {
   length(all_vars(expr)) == 0
 }
+
+handle_embedded_nul_error <- function(e) {
+  msg <- conditionMessage(e)
+  if (grepl(" nul ", msg)) {
+    e$message <- paste0(msg, "; to strip nuls when converting from Arrow to R, set options(arrow.skip_nul = TRUE)")
+  }
+  stop(e)
+}

Review comment:
       Is the call info in the error message at all informative? If not, you might want `stop(msg, call. = FALSE)` inside the conditional (after appending to the message of course).




-- 
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:
users@infra.apache.org