Skip to content

Commit

Permalink
Merge pull request #364 from r-dbi/b-dplyr
Browse files Browse the repository at this point in the history
chore: Avoid dplyr
  • Loading branch information
aviator-app[bot] authored Mar 30, 2024
2 parents 36242d2 + cb6c061 commit ecec086
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Suggests:
constructive,
debugme,
devtools,
dplyr,
knitr,
lintr,
pkgload,
Expand Down
12 changes: 2 additions & 10 deletions R/spec-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,15 @@ 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) {
class(.x) <- setdiff(class(.x), "AsIs")
.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)
Expand Down

0 comments on commit ecec086

Please sign in to comment.