Authorization for accessing BigQuery from R session on server

后端 未结 1 1761
悲哀的现实
悲哀的现实 2021-02-04 17:24

I am using R and package bigrquery to access Bigquery from an R session. This works great as long as I am on my local machine. However, when I try to access Bigquery from R on a

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-04 18:18

    By default httr, which is used by bigrquery for oauth, will look in the R session's current working directory for .httr-oauth. You can override this location with the following (perhaps putting it in your .Rprofile if you like):

    options("httr_oauth_cache"="~/.httr-oauth")
    

    But for error message you received, its seems like the location is not the issue and it might be easier to just redo the oauth flow on the remote server to cache a new credential. To trigger a new oauth flow on the remote server:

    1. ensure the .httr-oauth file does not exist
    2. restart R
    3. perform one query with bigrquery

    Note that if httr tries to redirect to localhost, you can force it to do an out-of-band oauth flow with:

    options(httr_oob_default = TRUE)
    

    0 讨论(0)
提交回复
热议问题