From 7afeea8338856beb9c08e9f5fade3d0917199c49 Mon Sep 17 00:00:00 2001 From: Todd Birchard Date: Sun, 25 Feb 2024 23:41:06 -0500 Subject: [PATCH] Parse GCP credentials prior to declaring `Credentials` pydantic type. --- config.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 7f82821d..c6c47e57 100644 --- a/config.py +++ b/config.py @@ -60,10 +60,8 @@ class Settings(BaseSettings): # Google Cloud Auth GCP_PROJECT_NAME: str = getenv("GCP_PROJECT_NAME") - GCP_JSON_CREDENTIALS: dict = getenv("GCP_JSON_CREDENTIALS") - GCP_CREDENTIALS: Credentials = service_account.Credentials.from_service_account_info( - json.loads(GCP_JSON_CREDENTIALS) - ) + GCP_JSON_CREDENTIALS: dict = json.loads(getenv("GCP_JSON_CREDENTIALS")) + GCP_CREDENTIALS: Credentials = service_account.Credentials.from_service_account_info(GCP_JSON_CREDENTIALS) # Google BigQuery GCP_BIGQUERY_TABLE: str = getenv("GCP_BIGQUERY_TABLE")