Created
July 28, 2023 23:31
-
-
Save perryism/23e1aee4193e085fe67bcef2f1004aa1 to your computer and use it in GitHub Desktop.
Query bigquery on behave of an user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.oauth2.credentials import Credentials | |
from google.cloud import bigquery | |
import google.oauth2.credentials | |
import os | |
PROJECT = os.environ.get("PROJECT") | |
# gcloud auth print-access-token | |
ACCESS_TOKEN = os.environ.get("ACCESS_TOKEN") | |
credentials = google.oauth2.credentials.Credentials(ACCESS_TOKEN) | |
client = bigquery.Client(project=PROJECT, credentials=credentials) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment