Created
February 23, 2024 12:41
-
-
Save salvadorgascon/656c953544f119e4e8897aa4a91bf6c4 to your computer and use it in GitHub Desktop.
Python connection to Google Cloud BigQuery
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
import os | |
from pathlib import Path | |
from google.cloud import storage | |
# Use Google Cloude IAM to generate valida keys and set permissions | |
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.path.join(Path(__file__).parent,"google-keys.json") | |
print("Connecting to Google Cloud BigQuery ...", end="") | |
bigquery_client = bigquery.Client() | |
print("OK") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment