thisisnic commented on a change in pull request #10056:
URL: https://github.com/apache/arrow/pull/10056#discussion_r616566652



##########
File path: r/R/arrow-tabular.R
##########
@@ -211,6 +211,29 @@ head.ArrowTabular <- head.ArrowDatum
 #' @export
 tail.ArrowTabular <- tail.ArrowDatum
 
+#' @export
+na.fail.ArrowTabular <- function(object, ...){
+  na_count <- sum(purrr::map_int(object$columns, ~.x$null_count))
+  if(na_count > 0){
+    stop("missing values in object")
+  }
+  object
+}
+
+#' @export
+na.omit.ArrowTabular <- function(object, ...){
+  filter_text = paste0(
+    ".data$Filter(",
+    paste0("!is.na(.data$", names(object), ")", collapse = " & "),
+    ")"
+  )
+  filter = rlang::parse_expr(filter_text)
+  rlang::eval_tidy(filter,  rlang::new_data_mask(rlang::env(.data = object)))
+}

Review comment:
       Is how I've implemented this OK?  It feels bad/wrong in a way I can't 
quite articulate to construct a call to filter this way, or is it alright as 
I've done it with a data mask etc?




-- 
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