in components/processing/libs/processor-base/src/processors/base/gcsio.py [0:0]
def read_as_obj(self):
"""Read the file or object as a GCS object"""
logger.debug("Reading %s as GCS object", str(self))
# As a bucket, read directly
if self.bucket:
yield str(self)
return
# Generate a temporary object
tmp_obj_name = Path(self.path).name
tmp_obj = GCSPath(
f"{GCS_TMP_PREFIX}/tmp-prefix-{str(uuid.uuid4())}/{tmp_obj_name}"
)
# Upload it to GCS
self.copy(tmp_obj)
yield str(tmp_obj)
tmp_obj.delete()