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 per #541 #542

Merged
merged 2 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# bigrquery (development version)

# bigrquery 1.4.3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this heading; we add during the release process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done thanks @hadley


* Align Google APIs URLs to Google Cloud Discovery docs. This enables support for Private and Restricted Google APIs configurations.
- `R/bq-request.R`
- Substitute `https://bigquery.googleapis.com` for `https://www.googleapis.com`
- `R/gs-object.R`
- Substitute `https://storage.googleapis.com` for `https://www.googleapis.com`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add the issue number and your name? See details at https://style.tidyverse.org/news.html#acknowledgement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done thanks @hadley


# bigrquery 1.4.2

* Sync up with the current release of gargle (1.4.0). Recently gargle
Expand Down
4 changes: 2 additions & 2 deletions R/bq-request.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
base_url <- "https://www.googleapis.com/bigquery/v2/"
upload_url <- "https://www.googleapis.com/upload/bigquery/v2/"
base_url <- "https://bigquery.googleapis.com/bigquery/v2/"
upload_url <- "https://bigquery.googleapis.com/upload/bigquery/v2/"

prepare_bq_query <- function(query) {
api_key <- Sys.getenv("BIGRQUERY_API_KEY")
Expand Down
4 changes: 2 additions & 2 deletions R/gs-object.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ print.gs_object <- function(x, ...) {
}

gs_object_delete <- function(x, token = bq_token()) {
url <- glue_data(x, "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}")
url <- glue_data(x, "https://storage.googleapis.com/storage/v1/b/{bucket}/o/{object}")
req <- httr::DELETE(url, token, httr::user_agent(bq_ua()))
process_request(req)
}

gs_object_exists <- function(x, token = bq_token()) {
url <- glue_data(x, "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}")
url <- glue_data(x, "https://storage.googleapis.com/storage/v1/b/{bucket}/o/{object}")
req <- httr::GET(url, token, httr::user_agent(bq_ua()))
req$status_code != 404
}