R/rows_append.R

Defines functions duckplyr_rows_append rows_append.duckplyr_df

# Generated by 02-duckplyr_df-methods.R
#' @export
rows_append.duckplyr_df <- function(x, y, ..., copy = FALSE, in_place = FALSE) {
  # Our implementation
  rel_try(NULL,
    "No relational implementation for rows_append()" = TRUE,
    {
      return(out)
    }
  )

  # dplyr forward
  rows_append <- dplyr$rows_append.data.frame
  out <- rows_append(x, y, ..., copy = copy, in_place = in_place)
  return(out)

  # dplyr implementation
  check_dots_empty()
  rows_df_in_place(in_place)

  y <- auto_copy(x, y, copy = copy)

  rows_check_x_contains_y(x, y)
  y <- rows_cast_y(y, x)

  rows_bind(x, y)
}

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