From 70dcf3dad42f17e3e1afae384b2e8247161c31e7 Mon Sep 17 00:00:00 2001 From: Patrick Miller Date: Wed, 19 Jun 2019 16:45:13 -0500 Subject: [PATCH] 2.0 release (#187) * MAINT spelling * CHANGELOG * cran comments * FIX: add vignette title --- CHANGELOG.md | 2 +- R/reports.R | 6 ++--- R/tables.R | 34 ++++++++++++++-------------- cran-comments.md | 6 ++--- man/refresh_table.Rd | 2 +- man/transfer_table.Rd | 12 +++++----- vignettes/civis_scripts.Rmd | 2 +- vignettes/concurrency.Rmd | 4 ++-- vignettes/data_import_and_export.Rmd | 2 +- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61c35e14..fe6c47df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [2.0.0] - Unreleased +## [2.0.0] - 2019-06-19 ### Changed diff --git a/R/reports.R b/R/reports.R index 37c8977a..c7e8bf09 100644 --- a/R/reports.R +++ b/R/reports.R @@ -9,7 +9,7 @@ #' @param project_id integer, Project_id that the report should be added to. #' @param ... additional parameters to send to \code{rmarkdown::render}. Note: #' A temporary file will be used for \code{output_file} if \code{output_file} -#' is not explicity set and \code{input} will be overwritten with +#' is not explicitly set and \code{input} will be overwritten with #' \code{rmd_file}. #' #' @details @@ -24,7 +24,7 @@ #' } #' Since \code{report_id} is set, this code will overwrite the existing #' report with that number, which may be useful when updating a report on -#' a schedule. Any argument passed in explicity to \code{publish_rmd} +#' a schedule. Any argument passed in explicitly to \code{publish_rmd} #' will be used in place of the corresponding argument set in YAML metadata. #' #' @note @@ -54,7 +54,7 @@ publish_rmd <- function(rmd_file, report_id=NULL, report_name=NULL, render_args <- list(...) # Look for publish_html args in the yaml of the RMarkdown file, overwriting - # the arg if it is explicity passed into publish_rmd + # the arg if it is explicitly passed into publish_rmd html_args <- parse_front_matter(rmd_file)[["civis"]] html_args <- if (is.null(html_args)) list() else html_args if (!missing(report_id)) html_args[["report_id"]] <- report_id diff --git a/R/tables.R b/R/tables.R index 8769081c..ba3581b5 100644 --- a/R/tables.R +++ b/R/tables.R @@ -1,26 +1,26 @@ #' Transfer a table from one location to another. #' -#' @param source_db string or int, The name of the database where the source table is located. +#' @param source_db string or int, The name of the database where the source table is located. #' Optionally, could be the database ID. -#' @param dest_db string or int, The name of the database where the table will be transfered. +#' @param dest_db string or int, The name of the database where the table will be transferred. #' Optionally, could be the database ID. #' @param source_table string, Full name of the table to transfer, #' e.g., \code{"schema.table"}. #' @param dest_table string, Full name of the table in the destination database, #' e.g., \code{"schema.table"}. -#' @param job_name string, optional, A name to give the job. -#' If omitted, a random job name will be used. -#' @param source_credential_id string or int, Optional credential ID +#' @param job_name string, optional, A name to give the job. +#' If omitted, a random job name will be used. +#' @param source_credential_id string or int, Optional credential ID #' for the source database. If \code{NULL}, the default credential will be used. -#' @param dest_credential_id string or int, Optional credential ID +#' @param dest_credential_id string or int, Optional credential ID #' for the source database. If \code{NULL}, the default credential will be used. -#' @param interval Number of seconds to wait between checks for job completion. +#' @param interval Number of seconds to wait between checks for job completion. #' If \code{NULL}, the default exponential backoff from \code{await} will be used. #' @param verbose bool, Set to TRUE to print intermediate progress indicators. #' @return A \code{civis_api} object. #' @param advanced_options A list of advanced options for the sync. See \code{\link{imports_post_syncs}} for #' details. -#' @examples +#' @examples #' \dontrun{ #' transfer_table(source_db='Cluster A', dest_db='Cluster B', #' source_table='schma.tbl', dest_table='schma.tbl') @@ -28,34 +28,34 @@ #' @export #' @family tables transfer_table <- function(source_db, dest_db, source_table, dest_table, - job_name = NULL, + job_name = NULL, source_credential_id = NULL, dest_credential_id = NULL, interval = NULL, verbose = FALSE, advanced_options = NULL) { - + if (is.null(source_credential_id)) source_credential_id <- default_credential() if (is.null(dest_credential_id)) dest_credential_id <- default_credential() if (is.null(job_name)) job_name <- "R Client transfer table" - + source <- list("remoteHostId" = get_database_id(source_db), "credentialId" = source_credential_id) - destination <- list("remoteHostId" = get_database_id(dest_db), + destination <- list("remoteHostId" = get_database_id(dest_db), "credentialId" = dest_credential_id) id <- imports_post(job_name, sync_type = "Dbsync", is_outbound = TRUE, source = source, destination = destination)$id - args <- list(id = id, source = list(path = source_table), + args <- list(id = id, source = list(path = source_table), destination = list(path = dest_table)) if (!is.null(advanced_options)) { args <- c(args, list(advanced_options = advanced_options)) } - + do.call(imports_post_syncs, args) run_id <- imports_post_runs(id = id)$runId - await(imports_get_files_runs, id = id, run_id = run_id, + await(imports_get_files_runs, id = id, run_id = run_id, .interval = interval, .verbose = verbose) } #' Refresh a table -#' @description Refreshes a table on Redshift using \code{\link{tables_post_refresh}}, which runs the +#' @description Refreshes a table on Redshift using \code{\link{tables_post_refresh}}, which runs the #' table scanner and updates table meta-data. #' @param tablename string, Name of table and schema \code{"schema.tablename"} #' @param database string, Name of database where data frame is to be uploaded. If no database is specified, @@ -68,7 +68,7 @@ refresh_table <- function(tablename, database = NULL, verbose = FALSE) { db <- get_db(database) table_id <- get_table_id(tablename, db) tables_post_refresh(table_id) - await(tables_get, id = table_id, .status_key = "refreshStatus", + await(tables_get, id = table_id, .status_key = "refreshStatus", .success_states = c("current"), .error_states = c("stale"), .verbose = verbose) } diff --git a/cran-comments.md b/cran-comments.md index 2ea5a591..d2df0c4a 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,8 +1,8 @@ -The version has been bumped to 1.6.1, fixing the broken link from the previous -submission. +The version has been bumped to 2.0.0, removing many dependencies, adding features, +and providing new documentation. ## Test environments -* local OS X install, R 3.5.2 +* local OS X install, R 3.6.0 * ubuntu 14.04 (oldrel, release, devel) * ubuntu 16.04, Fedora Linux * win-builder (devel), windows serrver 2008 diff --git a/man/refresh_table.Rd b/man/refresh_table.Rd index fbe8d73a..8c9b1531 100644 --- a/man/refresh_table.Rd +++ b/man/refresh_table.Rd @@ -18,7 +18,7 @@ uses \code{options(civis.default_db)}} Returns table meta-data from \code{\link{tables_get}}. } \description{ -Refreshes a table on Redshift using \code{\link{tables_post_refresh}}, which runs the +Refreshes a table on Redshift using \code{\link{tables_post_refresh}}, which runs the table scanner and updates table meta-data. } \seealso{ diff --git a/man/transfer_table.Rd b/man/transfer_table.Rd index 65c8e363..9a272e40 100644 --- a/man/transfer_table.Rd +++ b/man/transfer_table.Rd @@ -10,10 +10,10 @@ transfer_table(source_db, dest_db, source_table, dest_table, advanced_options = NULL) } \arguments{ -\item{source_db}{string or int, The name of the database where the source table is located. +\item{source_db}{string or int, The name of the database where the source table is located. Optionally, could be the database ID.} -\item{dest_db}{string or int, The name of the database where the table will be transfered. +\item{dest_db}{string or int, The name of the database where the table will be transferred. Optionally, could be the database ID.} \item{source_table}{string, Full name of the table to transfer, @@ -22,16 +22,16 @@ e.g., \code{"schema.table"}.} \item{dest_table}{string, Full name of the table in the destination database, e.g., \code{"schema.table"}.} -\item{job_name}{string, optional, A name to give the job. +\item{job_name}{string, optional, A name to give the job. If omitted, a random job name will be used.} -\item{source_credential_id}{string or int, Optional credential ID +\item{source_credential_id}{string or int, Optional credential ID for the source database. If \code{NULL}, the default credential will be used.} -\item{dest_credential_id}{string or int, Optional credential ID +\item{dest_credential_id}{string or int, Optional credential ID for the source database. If \code{NULL}, the default credential will be used.} -\item{interval}{Number of seconds to wait between checks for job completion. +\item{interval}{Number of seconds to wait between checks for job completion. If \code{NULL}, the default exponential backoff from \code{await} will be used.} \item{verbose}{bool, Set to TRUE to print intermediate progress indicators.} diff --git a/vignettes/civis_scripts.Rmd b/vignettes/civis_scripts.Rmd index daaa5fd4..012fb86e 100644 --- a/vignettes/civis_scripts.Rmd +++ b/vignettes/civis_scripts.Rmd @@ -4,7 +4,7 @@ author: "Patrick Miller" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Vignette Title} + %\VignetteIndexEntry{Productionizing with Civis Scripts} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- diff --git a/vignettes/concurrency.Rmd b/vignettes/concurrency.Rmd index c837b8b6..fbfbb152 100644 --- a/vignettes/concurrency.Rmd +++ b/vignettes/concurrency.Rmd @@ -53,7 +53,7 @@ a call to `civis_ml`, Platform builds the model while your laptop waits for the task to complete. This means that you don't have to worry about running out of memory or cpu cores on your laptop when training dozens of models, or when scoring a model on a very large population. The task being -parallized in the code below is simply the task of waiting for Platform to +parallelized in the code below is simply the task of waiting for Platform to send results back to your laptop. @@ -153,5 +153,5 @@ certain operating systems. If you encounter an error parallelizing functions in `civis`, we recommend first trying more than one method listed above. While we will address errors specific to `civis` with regards to parallel code, the technicalities of parallel libraries in -R across operating systems and enviroments prevent us from providing +R across operating systems and environments prevent us from providing more general support for issues regarding parallelized code in R. diff --git a/vignettes/data_import_and_export.Rmd b/vignettes/data_import_and_export.Rmd index f604a591..5d364e76 100644 --- a/vignettes/data_import_and_export.Rmd +++ b/vignettes/data_import_and_export.Rmd @@ -37,7 +37,7 @@ and arbitrary R objects are serialized using `saveRDS` for speed and efficiency. ## Reading Data Into R From Platform -The main workhose for getting data from Platform is `read_civis`. +The main workhorse for getting data from Platform is `read_civis`. This function is designed to work similarly to the built in function `read.csv`, returning a dataframe from a table in Platform. For more flexibility, `read_civis` can download files from Redshift using an SQL query, or download a