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



##########
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:
       (After separate a conversation on Hangouts with @jonkeane , we agreed 
that this might not be the best way to do this and so I'm going to have a go at 
implementing this using `purrr` instead.)




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