in components/processing/libs/processor-base/src/processors/base/gcsio.py [0:0]
def write_as_obj(self):
"""Write file or object as an object"""
logger.debug("Writing %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}"
)
# Write as the object
yield str(tmp_obj)
# Download it to local file
tmp_obj.copy(self)
# Delete it
tmp_obj.delete()