Skip to content

Commit

Permalink
version 0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Edmondson authored and cran-robot committed Jun 8, 2018
1 parent ff2389d commit 09ef95d
Show file tree
Hide file tree
Showing 39 changed files with 925 additions and 174 deletions.
13 changes: 7 additions & 6 deletions DESCRIPTION
@@ -1,6 +1,6 @@
Package: bigQueryR
Title: Interface with Google BigQuery with Shiny Compatibility
Version: 0.3.2
Version: 0.4.0
Authors@R: c(person("Mark", "Edmondson",email = "r@sunholo.com",
role = c("aut", "cre")),
person("Hadley", "Wickham", , "hadley@rstudio.com", role = "ctb")
Expand All @@ -13,16 +13,17 @@ URL: http://code.markedmondson.me/bigQueryR/
BugReports: https://github.com/cloudyr/bigQueryR/issues
License: MIT + file LICENSE
LazyData: TRUE
Depends: R (>= 3.2.0)
Imports: googleAuthR (>= 0.6.0), googleCloudStorageR (>= 0.2.0),
Depends: R (>= 3.2)
Imports: googleAuthR (>= 0.6.2), googleCloudStorageR (>= 0.2.0),
jsonlite (>= 1.0), httr (>= 1.2.1), assertthat
Suggests: shiny (>= 0.12.1), knitr, rmarkdown, testthat
Suggests: shiny (>= 0.12.1), knitr, rmarkdown, testthat, data.table,
purrr
RoxygenNote: 6.0.1
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2017-10-23 20:48:21 UTC; mark
Packaged: 2018-06-08 14:39:47 UTC; mark
Author: Mark Edmondson [aut, cre],
Hadley Wickham [ctb]
Maintainer: Mark Edmondson <r@sunholo.com>
Repository: CRAN
Date/Publication: 2017-10-23 20:55:03 UTC
Date/Publication: 2018-06-08 15:15:43 UTC
70 changes: 38 additions & 32 deletions MD5
@@ -1,47 +1,51 @@
85fff63589ae1fe2d5a09e1e1588b332 *DESCRIPTION
bc5d43ec157f7bb48c7aa541318f5626 *DESCRIPTION
1918b8807c8b12031663a9efe23458e0 *LICENSE
bc6b17f202ec4268089cc692723e20ca *NAMESPACE
0672e04e825cf5f6d16621d37f0bc52e *NEWS.md
507112e884cad545d4d8f3d28efeda2e *R/auth.R
df4a137ee18409c5a9f17caa0c59d47a *NAMESPACE
b396f30684b7743f96b59f2d0e30b9fe *NEWS.md
f61bff9df17bbe6ee9bd0a4369d5aa02 *R/auth.R
086eb868dbba4a932d07a6733668b75d *R/bigQueryR.R
455eeee08045823b8139a02fcbe11184 *R/dataParseFunctions.R
5ffba2c79cacc86c5b313b1c8405c767 *R/downloadData.R
2c421cc2f3b9e1495cc7eaa2ee2e9455 *R/globals.R
68d75a7ae77b9432833e0e1332f1a668 *R/jobs.R
0fcd82dcfd2cdaebccfc403dd14e8190 *R/listBigQuery.R
26119f0c9d0b787fa084c36e4e15de7a *R/options.R
81db1fd0980ae48495ef1bbe780eafe8 *R/partition.R
4fcedd2524f11131bff92a22277f68e0 *R/print_methods.R
70de4f4ca9d5bf1fca6a4ab86c725650 *R/query.R
eef5d355fb0e6bab3f7a4a456baeb9d7 *R/tables.R
755b8b0ce51436d58e6ccb8f6172566b *R/uploadData.R
cc64b65f1d2fb7b5f6a6c949b01f2118 *R/fastBqDownload.R
8826ed94d28e225a877c242efba2c3ac *R/globals.R
99c749e242e5cbcdf361700c6bd27a8e *R/jobs.R
a6ad5a9053110e74090f6edfeda97b2e *R/listBigQuery.R
446ce1fed063486326a237835a96c612 *R/options.R
fabc531a4fb1745adbc418356c86cde8 *R/partition.R
707d2e2b054f32eea17cee0ad443de69 *R/print_methods.R
8be4c29f50d125ab85a757a74f658b4d *R/query.R
dec4f138ee701b2b8562cf35a6f19e51 *R/tables.R
4d902bc1766d9c8f83bf58cd3075df66 *R/uploadData.R
9496906eb59ad8d07b86d1a0edfca1c4 *R/utilities.R
1c54afe76713250972cdbf35f6bb74e2 *build/vignette.rds
a7919bdca0b3756becabb446f90e716e *build/vignette.rds
e8d818d4be126d9c02920eb65f6437f9 *inst/CITATION
f6ecb2e3614716b168d1021661dd33d2 *inst/client.json
59d79154d6247524cbbc88634227446a *inst/doc/bigQueryR.Rmd
f2ca526ff7ad5768864c4f6de76592bf *inst/doc/bigQueryR.html
951a0e60c14b70509570bf72e206e608 *inst/doc/bigQueryR.html
f79d7c7ac5251dc6a23a6b017defdb76 *man/bigQueryR.Rd
f2eaee4efd44db76c75a716149aba951 *man/bq_get_global_dataset.Rd
791f0abace3714d39e1e8756a20d263b *man/bq_get_global_project.Rd
7f09fd4c7f5568d6ca0d5698790d6198 *man/bq_global_dataset.Rd
2f56650fb57a829047a39efaec6da112 *man/bq_global_project.Rd
b3f9e03bb6da6feb766bfad852b58cc8 *man/bqr_auth.Rd
5f1404486f0cf5766c533a467df13929 *man/bqr_create_table.Rd
6336dd1c3338a540170f4bc92f4086ed *man/bqr_delete_table.Rd
376789841378bdce8f1a8e16c7c15a8b *man/bqr_auth.Rd
c30bedb0bb7cf77d6ec24135918cd89f *man/bqr_copy_table.Rd
824c00fcf6d60fae95a7a92b24df95a4 *man/bqr_create_table.Rd
dd4d7b60bb963df67b8541d87b6ba05a *man/bqr_delete_table.Rd
167a725f3e64f66bac5a373787a891fb *man/bqr_download_extract.Rd
adabec2720b7a2a7c4095d0cbf10161a *man/bqr_download_query.Rd
3f9ef0221ea290493a4531cbcd765a2c *man/bqr_extract_data.Rd
185fcec6d220ac634a599c672913c283 *man/bqr_get_job.Rd
16a9b26db84c8a44add352b8728de358 *man/bqr_get_global_dataset.Rd
71c1c0cd2be6f6acb2a621029cd94c87 *man/bqr_get_global_project.Rd
7ec69f4996bf260d19a2ac8c8284e773 *man/bqr_get_job.Rd
3a78ea5133fe17de197e08033ad0831e *man/bqr_global_dataset.Rd
71e162eb1eb6369937ab8d5a22f778c3 *man/bqr_global_project.Rd
16f5371ae462ea0748418e75d269ca6d *man/bqr_grant_extract_access.Rd
bbf59a86db782fe7738e324eadc78e85 *man/bqr_list_datasets.Rd
19820c74cad33004d559b82769578b46 *man/bqr_list_jobs.Rd
08de6d42038acbf94264d6f69d6486ee *man/bqr_list_datasets.Rd
666fa52479244ade900c02b6f7e60b1f *man/bqr_list_jobs.Rd
06604537eb32badf650c0272e2174a39 *man/bqr_list_projects.Rd
b8c81fbd5f4028e1141498493eef45c1 *man/bqr_list_tables.Rd
c18ee700f5ca01827f1727a2829e7e4c *man/bqr_partition.Rd
282f8c0b94ca8120c4bb3c6b8b0abc16 *man/bqr_query.Rd
219d4fe9e4e83d3107a24839f039cc59 *man/bqr_query_asynch.Rd
6e0461025cc743c5bdeea70902f86914 *man/bqr_table_data.Rd
1d8dd1834db2e3b1d997da63bb6ef9f9 *man/bqr_table_meta.Rd
fa5d7faf959fcf014cced69a653fa418 *man/bqr_upload_data.Rd
51d692bb90281c42b425ee74d04279c5 *man/bqr_list_tables.Rd
242e0b96b5efafe78069f766ca9f700e *man/bqr_partition.Rd
0fd988d3db17ff020081320f91cc4870 *man/bqr_query.Rd
7723389803b36d88b64842e9e8c145c8 *man/bqr_query_asynch.Rd
8039c2ad64f5abbe4ed48bd6b89483b0 *man/bqr_table_data.Rd
58b629df0bad9a8dabf13ffea1d6b1a1 *man/bqr_table_meta.Rd
0ed7d37da19347c22a8d61c3c94cfe60 *man/bqr_upload_data.Rd
0b5f0797e3de31820545e97f634e41d0 *man/bqr_wait_for_job.Rd
cd4ec4d5e7dbb8040424decf497029be *man/cat0.Rd
4bbba36b86bbc6eed98145c48630cc03 *man/error.message.Rd
Expand All @@ -55,4 +59,6 @@ d73a74c4a41bb745e0c47c8e69b1008b *man/parse_bqr_query.Rd
c9fdcdaed7c24bf33774de3e5207116c *man/rmNullObs.Rd
4f517b883d180122b87094234afadacb *man/schema_fields.Rd
95592f7be17d720b52e846ab24cb9e32 *man/timestamp_to_r.Rd
2053e23752bee1f280b8eaa6f225a439 *tests/testthat.R
d0a2db08ac4341e022a35b3d3221f982 *tests/testthat/test_query.R
59d79154d6247524cbbc88634227446a *vignettes/bigQueryR.Rmd
12 changes: 11 additions & 1 deletion NAMESPACE
Expand Up @@ -6,11 +6,17 @@ export(bq_get_global_project)
export(bq_global_dataset)
export(bq_global_project)
export(bqr_auth)
export(bqr_copy_table)
export(bqr_create_table)
export(bqr_delete_table)
export(bqr_download_extract)
export(bqr_download_query)
export(bqr_extract_data)
export(bqr_get_global_dataset)
export(bqr_get_global_project)
export(bqr_get_job)
export(bqr_global_dataset)
export(bqr_global_project)
export(bqr_grant_extract_access)
export(bqr_list_datasets)
export(bqr_list_jobs)
Expand All @@ -24,6 +30,10 @@ export(bqr_table_meta)
export(bqr_upload_data)
export(bqr_wait_for_job)
export(schema_fields)
import(googleAuthR)
import(assertthat)
import(googleCloudStorageR)
importFrom(googleAuthR,gar_auth)
importFrom(googleAuthR,gar_auto_auth)
importFrom(googleAuthR,gar_set_client)
importFrom(stats,setNames)
importFrom(tools,file_ext)
17 changes: 14 additions & 3 deletions NEWS.md
@@ -1,9 +1,20 @@
# bigQuery 0.3.2
# bigQueryR 0.4.0

* support `nullMarker`, `maxBadRecords`, `fieldDelimiter` in upload jobs
* Support BigQuery type `DATE` for R class `Date` data.frame columns (BigQuery type `TIMESTAMP` still default for `POSIXct`columns) (#48)
* Allow custom user schema for uploads of data.frames (#48)
* Rename misnamed global functions from `bq_` prefix to `bqr_` prefix
* Add `allowJaggedRows` and `allowQuotedNewlines` options to upload via `bqr_upload_data()`
* `bqr_get_job` now accepts a job object as well as the jobId
* Fix bug with `bqr_upload_data` where `autodetect=TRUE` didn't work with `gcs://` loads from Cloud Storage
* Fix bug with `bqr_query()` that caused a 404 error sometimes.

# bigQueryR 0.3.2

* Move to new batch endpoint (#41)
* Remove travis env arg

# bigQuery 0.3.1

# bigQueryR 0.3.1

* Fix asynch job fail if user previously `set.seed()` (#37)
* skip tests on CRAN causing error
Expand Down
26 changes: 16 additions & 10 deletions R/auth.R
Expand Up @@ -32,14 +32,14 @@ check_gcs_auth <- function(){
#' Authenticate this session
#'
#' A wrapper for \link[googleAuthR]{gar_auth} and \link[googleAuthR]{gar_auth_service}
#'
#'
#' @param token A preexisting token to authenticate with
#' @param new_user If TRUE, reauthenticate via Google login screen
#' @param no_auto Will ignore auto-authentication settings if TRUE
#'
#' If you have set the environment variable \code{BQ_AUTH_FILE} to a valid file location,
#' the function will look there for authentication details.
#' Otherwise it will look in the working directory for the `.httr-oauth` file, which if not present
#' will trigger an authentication flow via Google login screen in your browser.
#' Otherwise it will look in the working directory for the `bq.oauth` file, which if not present will trigger an authentication flow via Google login screen in your browser.
#'
#' If \code{BQ_AUTH_FILE} is specified, then \code{bqr_auth()} will be called upon loading the package
#' via \code{library(bigQueryR)},
Expand All @@ -49,18 +49,24 @@ check_gcs_auth <- function(){
#' service account JSON ending with file extension \code{.json}
#'
#' @return Invisibly, the token that has been saved to the session
#' @import googleAuthR
#' @importFrom googleAuthR gar_auth gar_auto_auth gar_set_client
#' @importFrom tools file_ext
#' @export
bqr_auth <- function(new_user = FALSE, no_auto = FALSE){
bqr_auth <- function(token = NULL, new_user = FALSE, no_auto = FALSE){

if(!is.null(token)){
return(gar_auth(token = token))
}

required_scopes <- c("https://www.googleapis.com/auth/bigquery",
"https://www.googleapis.com/auth/devstorage.full_control",
"https://www.googleapis.com/auth/cloud-platform")

googleAuthR::gar_auto_auth(required_scopes,
new_user = new_user,
no_auto = no_auto,
environment_var = "BQ_AUTH_FILE",
travis_environment_var = "TRAVIS_BQ_AUTH_FILE")
gar_set_client(system.file("client.json", package = "bigQueryR"),
scopes = required_scopes)

gar_auto_auth(required_scopes,
new_user = new_user,
no_auto = no_auto,
environment_var = "BQ_AUTH_FILE")
}

0 comments on commit 09ef95d

Please sign in to comment.