Skip to content

Commit

Permalink
2.0 release (#187)
Browse files Browse the repository at this point in the history
* MAINT spelling
* CHANGELOG
* cran comments
* FIX: add vignette title
  • Loading branch information
patr1ckm authored Jun 19, 2019
1 parent 99ad346 commit 70dcf3d
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## [2.0.0] - Unreleased
## [2.0.0] - 2019-06-19

### Changed

Expand Down
6 changes: 3 additions & 3 deletions R/reports.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
34 changes: 17 additions & 17 deletions R/tables.R
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
#' 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')
#' }
#' @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,
Expand All @@ -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)
}

Expand Down
6 changes: 3 additions & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion man/refresh_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions man/transfer_table.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/civis_scripts.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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}
---
Expand Down
4 changes: 2 additions & 2 deletions vignettes/concurrency.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand Down Expand Up @@ -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.
2 changes: 1 addition & 1 deletion vignettes/data_import_and_export.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 70dcf3d

Please sign in to comment.