You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2024/11/18 14:37:51 UTC
(beam) branch users/damccorm/notfound created (now 712b3262b51)
This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a change to branch users/damccorm/notfound
in repository https://gitbox.apache.org/repos/asf/beam.git
at 712b3262b51 Catch forbidden errors as notfound
This branch includes the following new commits:
new 712b3262b51 Catch forbidden errors as notfound
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(beam) 01/01: Catch forbidden errors as notfound
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
damccorm pushed a commit to branch users/damccorm/notfound
in repository https://gitbox.apache.org/repos/asf/beam.git
commit 712b3262b5159850fffa4d2d0bee999dda0d6038
Author: Danny McCormick <da...@google.com>
AuthorDate: Mon Nov 18 09:37:44 2024 -0500
Catch forbidden errors as notfound
---
sdks/python/apache_beam/io/gcp/gcsio.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sdks/python/apache_beam/io/gcp/gcsio.py b/sdks/python/apache_beam/io/gcp/gcsio.py
index 22a33fa13c6..83a79d8efa2 100644
--- a/sdks/python/apache_beam/io/gcp/gcsio.py
+++ b/sdks/python/apache_beam/io/gcp/gcsio.py
@@ -36,6 +36,7 @@ from typing import Optional
from typing import Union
from google.cloud import storage
+from google.cloud.exceptions import Forbidden
from google.cloud.exceptions import NotFound
from google.cloud.storage.fileio import BlobReader
from google.cloud.storage.fileio import BlobWriter
@@ -172,7 +173,7 @@ class GcsIO(object):
try:
return self.client.lookup_bucket(
bucket_name, retry=self._storage_client_retry, **kwargs)
- except NotFound:
+ except (Forbidden, NotFound):
return None
def create_bucket(