Skip to content

Commit 8e40313

Browse files
committed
Update doctstrings for 'Entity.save' and 'Connection.save_entity'.
Reinforce that previously-stored properties which don't have values set in the current entity instance will be removed.
1 parent ef53536 commit 8e40313

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

gcloud/datastore/connection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,9 @@ def save_entity(self, dataset_id, key_pb, properties):
339339
"""Save an entity to the Cloud Datastore with the provided properties.
340340
341341
.. note::
342-
Any existing properties for the entity will be cleared before
343-
applying those passed in 'properties'.
342+
Any existing properties for the entity identified by 'key_pb'
343+
will be replaced by those passed in 'properties'; properties
344+
not passed in 'properties' no longer be set for the entity.
344345
345346
:type dataset_id: string
346347
:param dataset_id: The dataset in which to save the entity.

gcloud/datastore/entity.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ def reload(self):
187187
def save(self):
188188
"""Save the entity in the Cloud Datastore.
189189
190+
.. note::
191+
Any existing properties for the entity will be replaced by those
192+
currently set on this instance. Already-stored properties which do
193+
not correspond to keys set on this instance will be removed from
194+
the datastore.
195+
190196
:rtype: :class:`gcloud.datastore.entity.Entity`
191197
:returns: The entity with a possibly updated Key.
192198
"""

0 commit comments

Comments
 (0)