R - bigrquery::bq_auth() function does not work - I can not reauthenticate to connect with BigQuery

306 Views Asked by At

First things first:

  • Operating System: Windows 10
  • R version: 4.2.2

Story I am trying to import data from Google BigQuery to R. I am using bigrquery package. However any operations after creating DBI connection results in the same way - I get error message saying Access Denied.

Here is the code:

# libs
library(bigrquery)
library(DBI)

# connection
con <- dbConnect(
  bigrquery::bigquery(),
  project = "project-nmae",
  dataset = "dataset",
  billing = "project-for_billing"
)

dbListTables(con)

Error I get:

Error in signal_reason(): ! Access Denied: Dataset x:y: Permission bigquery.tables.list denied on >dataset x:y (or it may not exist). [accessDenied]

Problem So OK. I have got multiple google accounts so I would like to force bigrquery to reauthenticate to make sure I am using proper one.

So as described in the documentation I am calling bq_auth(email=NA) and I expect that R should open browser with authentication page but nothing happens. No errors and totally no action.

I have also manually removed all tokens stored by gargle package. When I check tokens using gargle::gargle_oauth_sitrep() I get info that 0 tokens have been found. However it has not helped.

Question Does anyone know how to force bigrquery to reauthenticate and why bq_auth(email = NA) doesn't work?

0

There are 0 best solutions below