From c59cc4b5b60c15474d01dff972d28a8f2669920f Mon Sep 17 00:00:00 2001 From: eitsupi Date: Sat, 29 Oct 2022 08:54:01 +0000 Subject: [PATCH] support arrow Dataset --- R/compat.R | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/R/compat.R b/R/compat.R index 2ff64cf..323fce6 100644 --- a/R/compat.R +++ b/R/compat.R @@ -28,7 +28,15 @@ deparse <- function(expr, width.cutoff = 500, ...) { is_supported_data_object <- function(obj) { inherits( obj, - c("data.frame", "tbl", "dtplyr_step", "disk.frame", "arrow_dplyr_query", "ArrowTabular") + c( + "data.frame", + "tbl", + "dtplyr_step", + "disk.frame", + "arrow_dplyr_query", + "ArrowTabular", + "Dataset" + ) ) } is_grouped_data_object <- function(obj) { @@ -40,8 +48,10 @@ data_object_uses_function_translations <- function(obj) { column_names <- function(obj) { if (inherits(obj, "dtplyr_step")) { obj$vars - } else { + } else if (inherits(obj, "tbl")) { colnames(obj) + } else { + names(obj) } }