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


##########
sdks/python/apache_beam/io/gcp/gcsio.py:
##########
@@ -297,19 +308,32 @@ def copy(self, src, dest):
       dest: GCS file path pattern in the form gs://<bucket>/<name>.
 
     Raises:
-      TimeoutError: on timeout.
+      Any exceptions during copying
     """
     src_bucket_name, src_blob_name = parse_gcs_path(src)
     dest_bucket_name, dest_blob_name= parse_gcs_path(dest, 
object_optional=True)
     src_bucket = self.client.bucket(src_bucket_name)
-    src_blob = src_bucket.blob(src_blob_name)
+    if self._use_blob_generation:
+      src_blob = src_bucket.get_blob(src_blob_name)
+      if src_blob is None:
+        raise NotFound("source blob %s not found during copying" % src)
+      src_generation = getattr(src_blob, "generation", None)

Review Comment:
   Fixed.



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