R/collect.R

Defines functions duckplyr_collect collect.duckplyr_df

# Generated by 02-duckplyr_df-methods.R
#' @export
collect.duckplyr_df <- function(x, ...) {
  # Side effect: ALTREP materialization is triggered
  nrow(x)
  x
}

duckplyr_collect <- function(x, ...) {
  try_fetch(
    x <- as_duckplyr_df(x),
    error = function(e) {
      testthat::skip(conditionMessage(e))
    }
  )
  out <- collect(x, ...)
  class(out) <- setdiff(class(out), "duckplyr_df")
  out
}
duckdblabs/duckplyr documentation built on Nov. 6, 2024, 10 p.m.