shunping commented on code in PR #32428:
URL: https://github.com/apache/beam/pull/32428#discussion_r1764314433


##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -245,12 +249,21 @@ def delete(self, path):
     bucket_name, blob_name = parse_gcs_path(path)
     try:
       bucket = self.client.bucket(bucket_name)
-      bucket.delete_blob(blob_name)
+      if self._use_blob_generation:

Review Comment:
   > Since delete_blob below has retry=self._storage_client_retry, you can skip 
generations here as long as you don't care if there is an unexpected new 
version of the object due to some other process.
   
   The purpose of adding generation feature here is to give cx a way to 
mitigate possible race condition, so I will keep generation even if retry can 
happen with and without generation.
   
   > I would recommend wrapping the delete call in a try/except to catch and 
ignore 404 errors, though.
   
   It already has a try/except block to catch `NotFound` exception. Is that 
enough?



-- 
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]

Reply via email to