R/group_vars.R

Defines functions duckplyr_group_vars group_vars.duckplyr_df

# Generated by 02-duckplyr_df-methods.R
#' @export
group_vars.duckplyr_df <- function(x) {
  if (inherits(x, c("grouped_df", "rowwise_df"))) {
    return(dplyr$group_vars.data.frame(x))
  }

  # Avoid calling group_data()
  character()
}

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