diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29b..12d1b8ce 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - GCP uploads use permissions correctly diff --git a/policyengine_us_data/storage/upload_completed_datasets.py b/policyengine_us_data/storage/upload_completed_datasets.py index 72c59a3d..84f267d8 100644 --- a/policyengine_us_data/storage/upload_completed_datasets.py +++ b/policyengine_us_data/storage/upload_completed_datasets.py @@ -6,10 +6,14 @@ from policyengine_us_data.storage import STORAGE_FOLDER from policyengine_us_data.utils.huggingface import upload from google.cloud import storage +import google.auth def upload_datasets(): - storage_client = storage.Client() + credentials, project_id = google.auth.default() + storage_client = storage.Client( + credentials=credentials, project=project_id + ) bucket = storage_client.bucket("policyengine-us-data") datasets_to_upload = [ diff --git a/pyproject.toml b/pyproject.toml index 7f0c0c37..765adf77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ dependencies = [ "microimpute", "pip-system-certs", "google-cloud-storage", + "google-auth", ] [project.optional-dependencies]