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

dbFetch method cannot be called with quiet = TRUE #463

Closed
hdshea opened this issue Oct 6, 2021 · 2 comments · Fixed by #562
Closed

dbFetch method cannot be called with quiet = TRUE #463

hdshea opened this issue Oct 6, 2021 · 2 comments · Fixed by #562
Labels
bug an unexpected problem or unintended behavior DBI 🗃️

Comments

@hdshea
Copy link

hdshea commented Oct 6, 2021

A small issue - important for deploying though.

The dbFetch method (R/dbi-results.R) cannot be called with the quiet option. dbFetch is called with a res object, not a conn object and so does not have access to conn@quiet. It also does not (currently) take a quiet parameter. So, there is no way to make the internal call to bq_table_download (R/bq-download.R) employing either of the above options, and bq_table_download has the default quiet parameter set to NA.

if (gargle:::secret_can_decrypt("bigrquery")) {
  json <- gargle:::secret_read("bigrquery", "bigrquery-testing.json")
  bigrquery::bq_auth(path = rawToChar(json))
}
con <- DBI::dbConnect(
  bigquery(),
  project = bq_test_project(),
  dataset = "basedata",
  bigint = "integer"
)

res <- bigrquery::dbSendQuery(con, "SELECT cyl, mpg FROM mtcars")
rval <- bigrquery::dbFetch(res)
bigrquery::dbClearResult(res)

bigrquery::dbDisconnect(con)

Gives this output:

#> Downloading first chunk of data.
#> First chunk includes all requested rows.
@hdshea
Copy link
Author

hdshea commented Oct 7, 2021

Apologies, the call to DBI::dbConnect should have a quiet = TRUE in it.

@joranE
Copy link

joranE commented May 31, 2022

Discovered this myself recently. It really should be a trivial fix. I think you just need to include quiet = res@quiet in the bq_table_download call when defining the dbFetch method at line 115 in dbi-result.R

@hadley hadley added bug an unexpected problem or unintended behavior DBI 🗃️ labels Nov 3, 2023
hadley added a commit that referenced this issue Nov 7, 2023
And default to verbose output when snapshotting.

Fixes #463
hadley added a commit that referenced this issue Nov 7, 2023
And default to verbose output when snapshotting.

Fixes #463
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior DBI 🗃️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants