'BigQuery Fetch the Credentials again

I am using this code:

import pydata_google_auth
credentials = pydata_google_auth.get_user_credentials(
    ['https://www.googleapis.com/auth/bigquery'],
)

I have already logged in via OAuth before. Now I want to change the user credentials but it's taking from the old login only. It's not generating the URL again. How to force it to regenerate the URL again?



Solution 1:[1]

by Default a credential file will be saved at $HOME/.config/pydata/pydata_google_credentials.json or $APPDATA/.config/pydata/pydata_google_credentials.json on Windows.

Use the following to not save it, and you will have to authenticate when you run it:

import pydata_google_auth
credentials = pydata_google_auth.get_user_credentials(
    ['https://www.googleapis.com/auth/bigquery'], credentials_cache=pydata_google_auth.cache.NOOP
)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ewertonvsilva