claudevdm commented on code in PR #33148:
URL: https://github.com/apache/beam/pull/33148#discussion_r1846747095
##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -172,7 +173,7 @@ def get_bucket(self, bucket_name, **kwargs):
try:
return self.client.lookup_bucket(
bucket_name, retry=self._storage_client_retry, **kwargs)
- except NotFound:
+ except (Forbidden, NotFound):
Review Comment:
The method that is failing exists() [1], which calls _gcs_object().
The Forbidden error mentions it can be a permission issue or the bucket does
not exist. So we might swallow actual permission issues too.
I think we can list the buckets with a prefix to check for existence
explicitly.
```
client.list_buckets(prefix=bucket_name)
```
[1]
https://github.com/apache/beam/blob/8da9bbe484f86bb1da48989ddb3d1655fcc82a13/sdks/python/apache_beam/io/gcp/gcsio.py#L404
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]