From 83a943e48e0442fe1ee87c735ba1655e45f25e71 Mon Sep 17 00:00:00 2001 From: Claudia Chu Date: Thu, 26 Sep 2024 23:44:47 -0400 Subject: [PATCH] Update file_handlers.py get_requester_pays get_requester_pays() is incorrectly returning False for buckets that are requester-pays. Google's API suggests slightly different approach: https://cloud.google.com/storage/docs/using-requester-pays#storage-get-requester-pays-status-python bucket.reload() used in google's own API above: https://github.com/googleapis/python-storage/blob/e3cfc4786209c77e3c879c9ff2978f4884a0d677/google/cloud/storage/client.py#L870-L877 --- canine/localization/file_handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canine/localization/file_handlers.py b/canine/localization/file_handlers.py index 3293036..11f42f2 100644 --- a/canine/localization/file_handlers.py +++ b/canine/localization/file_handlers.py @@ -128,7 +128,7 @@ def get_requester_pays(self) -> bool: gcs_cl = gcloud_storage_client() bucket_obj = google.cloud.storage.Bucket(gcs_cl, bucket, user_project = self.extra_args.get("project")) - + bucket_obj.reload() return bucket_obj.requester_pays # TODO: handle case where permissions disallow bucket inspection?