Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Google APIs URLs with Discovery docs #82

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# bigQuery 0.5.0.9000

* Add missing numeric type for BigQuery schema parsing (#65)
* Align Google APIs URLs to Google Cloud Discovery docs. This enables support for Private and Restricted Google APIs configurations. (@husseyd, #81)
- Substitute `https://bigquery.googleapis.com` for `https://www.googleapis.com`

# bigQueryR 0.5.0

Expand Down
2 changes: 1 addition & 1 deletion R/datasets.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
bqr_list_datasets <- function(projectId = bqr_get_global_project()){

check_bq_auth()
l <- gar_api_generator("https://www.googleapis.com/bigquery/v2",
l <- gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"GET",
path_args = list(projects = projectId,
datasets = ""),
Expand Down
2 changes: 1 addition & 1 deletion R/downloadData.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bqr_extract_data <- function(projectId = bqr_get_global_project(),

## make job
job <-
googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"POST",
path_args = list(projects = projectId,
jobs = "")
Expand Down
6 changes: 3 additions & 3 deletions R/jobs.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ is.job <- function(x){
# metadata only jobs
call_job <- function(projectId, config){
l <-
googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"POST",
path_args = list(projects = projectId,
jobs = ""),
Expand Down Expand Up @@ -145,7 +145,7 @@ bqr_get_job <- function(jobId = .Last.value, projectId = bqr_get_global_project(

## make job
job <-
googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"GET",
path_args = list(projects = projectId,
jobs = jobId))
Expand Down Expand Up @@ -194,7 +194,7 @@ bqr_list_jobs <- function(projectId = bqr_get_global_project(),
options("googleAuthR.jsonlite.simplifyVector" = FALSE )
## make job
job <-
googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"GET",
path_args = list(projects = projectId,
jobs = ""),
Expand Down
2 changes: 1 addition & 1 deletion R/listBigQuery.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' @export
bqr_list_projects <- function(){
check_bq_auth()
l <- googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2/projects",
l <- googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2/projects",
"GET",
data_parse_function = function(x) {
d <- x$projects
Expand Down
6 changes: 3 additions & 3 deletions R/query.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ bqr_query <- function(projectId = bqr_get_global_project(),
body <- rmNullObs(body)

# solve 404?
the_url <- sprintf("https://www.googleapis.com/bigquery/v2/projects/%s/queries", projectId)
the_url <- sprintf("https://bigquery.googleapis.com/bigquery/v2/projects/%s/queries", projectId)

if(dryRun){
q <- googleAuthR::gar_api_generator(the_url,
Expand Down Expand Up @@ -95,7 +95,7 @@ bqr_query <- function(projectId = bqr_get_global_project(),
if(!is.null(pageToken)){
message("Paging through query results")
jobId <- attr(data, "jobReference")$jobId
pr <- googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
pr <- googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"GET",
path_args = list(projects = projectId,
queries = jobId),
Expand Down Expand Up @@ -213,7 +213,7 @@ bqr_query_asynch <- function(projectId = bqr_get_global_project(),
check_bq_auth()
## make job
job <-
googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"POST",
path_args = list(projects = projectId,
jobs = "")
Expand Down
12 changes: 6 additions & 6 deletions R/tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bqr_list_tables <- function(projectId = bqr_get_global_project(),


check_bq_auth()
l <- gar_api_generator("https://www.googleapis.com/bigquery/v2",
l <- gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"GET",
path_args = list(projects = projectId,
datasets = datasetId,
Expand Down Expand Up @@ -163,7 +163,7 @@ bqr_table_meta <- function(projectId = bqr_get_global_project(),
}


l <- googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
l <- googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"GET",
path_args = list(projects = projectId,
datasets = datasetId,
Expand Down Expand Up @@ -196,7 +196,7 @@ bqr_table_data <- function(projectId = bqr_get_global_project(),
tableId,
maxResults = 1000){
check_bq_auth()
l <- googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
l <- googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"GET",
path_args = list(projects = projectId,
datasets = datasetId,
Expand Down Expand Up @@ -242,7 +242,7 @@ bqr_create_table <- function(projectId = bqr_get_global_project(),
timePartitioning = FALSE,
expirationMs = 0L){
check_bq_auth()
l <- googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
l <- googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"POST",
path_args = list(projects = projectId,
datasets = datasetId,
Expand Down Expand Up @@ -320,7 +320,7 @@ bqr_patch_table <- function(Table){

myMessage("Patching ", tableId, level = 3)

the_url <- sprintf("https://www.googleapis.com/bigquery/v2/projects/%s/datasets/%s/tables/%s",
the_url <- sprintf("https://bigquery.googleapis.com/bigquery/v2/projects/%s/datasets/%s/tables/%s",
projectId, datasetId, tableId)

call_api <- gar_api_generator(the_url, "PATCH", data_parse_function = function(x) x)
Expand Down Expand Up @@ -349,7 +349,7 @@ bqr_delete_table <- function(projectId = bqr_get_global_project(),
datasetId = bqr_get_global_dataset(),
tableId){
check_bq_auth()
l <- googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
l <- googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"DELETE",
path_args = list(projects = projectId,
datasets = datasetId,
Expand Down
4 changes: 2 additions & 2 deletions R/uploadData.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ bqr_do_upload.data.frame <- function(upload_data,

do_obj_req <- function(mp_body, projectId, datasetId, tableId) {
l <-
googleAuthR::gar_api_generator("https://www.googleapis.com/upload/bigquery/v2",
googleAuthR::gar_api_generator("https://bigquery.googleapis.com/upload/bigquery/v2",
"POST",
path_args = list(projects = projectId,
jobs = ""),
Expand Down Expand Up @@ -441,7 +441,7 @@ bqr_do_upload.character <- function(upload_data,
config <- rmNullObs(config)

l <-
googleAuthR::gar_api_generator("https://www.googleapis.com/bigquery/v2",
googleAuthR::gar_api_generator("https://bigquery.googleapis.com/bigquery/v2",
"POST",
path_args = list(projects = projectId,
jobs = ""),
Expand Down