Skip to content

Commit 398addf

Browse files
committed
Merge pull request #236 from jgeewax/master
Updated docstring on Key.rename() with a warning.
2 parents 55adeb3 + 5d4a63a commit 398addf

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

gcloud/storage/key.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,17 @@ def exists(self):
134134
return self.bucket.get_key(self.name) is not None
135135

136136
def rename(self, new_name):
137-
"""Renames this key.
137+
"""Renames this key using copy and delete operations.
138138
139139
Effectively, copies key to the same bucket with a new name, then
140140
deletes the key.
141+
142+
.. warning::
143+
This method will first duplicate the data
144+
and then delete the old key.
145+
This means that with very large objects
146+
renaming could be a very (temporarily) costly
147+
or a very slow operation.
141148
142149
:type new_name: string
143150
:param new_name: The new name for this key.

0 commit comments

Comments
 (0)