Skip to content

Commit

Permalink
Parse GCP credentials prior to declaring Credentials pydantic type.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Feb 26, 2024
1 parent 555637c commit 7afeea8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7afeea8

Please sign in to comment.