From cb6c061c0b9e04656d96ad6d875465edea5bbe6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sat, 30 Mar 2024 23:24:03 +0100 Subject: [PATCH] chore: Avoid dplyr --- DESCRIPTION | 1 - R/spec-arrow.R | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f0cfdf3f9..fb33808c0 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -35,7 +35,6 @@ Suggests: constructive, debugme, devtools, - dplyr, knitr, lintr, pkgload, diff --git a/R/spec-arrow.R b/R/spec-arrow.R index a7bea3c02..ab261eed5 100644 --- a/R/spec-arrow.R +++ b/R/spec-arrow.R @@ -17,10 +17,6 @@ spec_arrow <- c( utils::globalVariables("select") stream_frame <- function(..., .select = NULL) { - if (!is_installed("dplyr")) { - skip("dplyr is not installed") - } - data <- data.frame(..., stringsAsFactors = FALSE, check.names = FALSE) as_is <- map_lgl(data, inherits, "AsIs") data[as_is] <- map(data[as_is], function(.x) { @@ -28,12 +24,8 @@ stream_frame <- function(..., .select = NULL) { .x }) - select <- enquo(.select) - - if (!quo_is_null(select)) { - data <- - data %>% - dplyr::select(!!select) + if (!is.null(.select)) { + data <- data[.select] } out <- nanoarrow::as_nanoarrow_array_stream(data)