Skip to content

Commit

Permalink
chore: Deprecate old I/O functions (#481)
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored Jan 22, 2025
1 parent eaa9e9d commit 8d9ad91
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/io-.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ df_from_file <- function(path,
options = list(),
class = NULL) {
check_dots_empty()
lifecycle::deprecate_soft("1.0.0", "df_from_file()", "read_file_duckdb()")

if (!rlang::is_character(path)) {
cli::cli_abort("{.arg path} must be a character vector.")
Expand Down Expand Up @@ -78,6 +79,7 @@ duckplyr_df_from_file <- function(
options = list(),
class = NULL) {
check_dots_empty()
lifecycle::deprecate_soft("1.0.0", "duckplyr_df_from_file()", "read_file_duckdb()")

out <- df_from_file(path, table_function, options = options, class = class)
as_duckplyr_df_impl(out)
Expand Down
2 changes: 2 additions & 0 deletions R/io-csv.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' )
df_from_csv <- function(path, ..., options = list(), class = NULL) {
check_dots_empty()
lifecycle::deprecate_soft("1.0.0", "df_from_csv()", "read_csv_duckdb()")

df_from_file(path, "read_csv_auto", options = options, class = class)
}
Expand All @@ -52,6 +53,7 @@ df_from_csv <- function(path, ..., options = list(), class = NULL) {
#' unlink(c(path, path2))
duckplyr_df_from_csv <- function(path, ..., options = list(), class = NULL) {
check_dots_empty()
lifecycle::deprecate_soft("1.0.0", "duckplyr_df_from_csv()", "read_csv_duckdb()")

duckplyr_df_from_file(path, "read_csv_auto", options = options, class = class)
}
3 changes: 3 additions & 0 deletions R/io-parquet.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' @export
df_from_parquet <- function(path, ..., options = list(), class = NULL) {
check_dots_empty()
lifecycle::deprecate_soft("1.0.0", "df_from_parquet()", "read_parquet_duckdb()")

df_from_file(path, "read_parquet", options = options, class = class)
}
Expand All @@ -20,6 +21,7 @@ df_from_parquet <- function(path, ..., options = list(), class = NULL) {
#' @export
duckplyr_df_from_parquet <- function(path, ..., options = list(), class = NULL) {
check_dots_empty()
lifecycle::deprecate_soft("1.0.0", "duckplyr_df_from_parquet()", "read_parquet_duckdb()")

duckplyr_df_from_file(path, "read_parquet", options = options, class = class)
}
Expand Down Expand Up @@ -51,6 +53,7 @@ duckplyr_df_from_parquet <- function(path, ..., options = list(), class = NULL)
#'
#' unlink(path_parquet)
df_to_parquet <- function(data, path) {
lifecycle::deprecate_soft("1.0.0", "df_to_parquet()", "compute_parquet()")
rel <- duckdb_rel_from_df(data)
duckdb$rel_to_parquet(rel, path)
}

0 comments on commit 8d9ad91

Please sign in to comment.