nealrichardson commented on a change in pull request #11373:
URL: https://github.com/apache/arrow/pull/11373#discussion_r727315248



##########
File path: r/R/dplyr.R
##########
@@ -162,22 +162,35 @@ as.data.frame.arrow_dplyr_query <- function(x, row.names 
= NULL, optional = FALS
 
 #' @export
 head.arrow_dplyr_query <- function(x, n = 6L, ...) {
-  # TODO (ARROW-13893): refactor
-  out <- head.Dataset(x, n, ...)
-  restore_dplyr_features(out, x)
+  out <- as_adq(x)
+  out$head <- n
+  collapse.arrow_dplyr_query(out)
 }
 
 #' @export
 tail.arrow_dplyr_query <- function(x, n = 6L, ...) {
-  # TODO (ARROW-13893): refactor
-  out <- tail.Dataset(x, n, ...)
-  restore_dplyr_features(out, x)
+  out <- as_adq(x)

Review comment:
       You are right, it's not needed since we don't reuse this method for 
Datasets 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.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to