Skip to content

Commit

Permalink
rename function to be more generic. User can choose table generating …
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
Tmonster committed Jun 6, 2023
1 parent d4ea493 commit d6714d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ S3method(ungroup,duckplyr_df)
S3method(union,duckplyr_df)
S3method(union_all,duckplyr_df)
export(as_duckplyr_df)
export(duckdb_from_csv)
export(duckdb_from_file)
export(duckdb_rel_from_df)
export(duckplyr_df_from_csv)
export(duckplyr_df_from_file)
export(is_duckplyr_df)
export(methods_overwrite)
export(methods_restore)
Expand Down
10 changes: 5 additions & 5 deletions R/csv.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#' @export
duckdb_from_csv <- function(path) {
duckdb_from_file <- function(path, table_function, options=list()) {
# FIXME: For some reason, it's important to create an alias here
con <- get_default_duckdb_connection()

out <- duckdb:::rel_from_table_function(
con,
'read_csv_auto',
table_function,
list(path),
list()
options
)

meta_rel_register_csv(out, path)
Expand All @@ -16,7 +16,7 @@ duckdb_from_csv <- function(path) {
}

#' @export
duckplyr_df_from_csv <- function(path) {
out <- duckdb_from_csv(path)
duckplyr_df_from_file <- function(path, table_function, options=list()) {
out <- duckdb_from_file(path, table_function, options)
as_duckplyr_df(out)
}

0 comments on commit d6714d2

Please sign in to comment.