Skip to content

Commit 162f508

Browse files
committed
Note protobuf RPCs mapped by connection methods.
Remove section header comments, per @dhermes feedback.
1 parent eff498d commit 162f508

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

gcloud/datastore/connection.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,11 @@ def dataset(self, *args, **kwargs):
153153
kwargs['connection'] = self
154154
return Dataset(*args, **kwargs)
155155

156-
#
157-
# Protobuf RPCs for DatastoreService
158-
#
159156
def lookup(self, dataset_id, key_pbs):
160157
"""Lookup keys from a dataset in the Cloud Datastore.
161158
159+
Maps the ``DatastoreService.Lookup`` protobuf RPC.
160+
162161
This method deals only with protobufs
163162
(:class:`gcloud.datastore.datastore_v1_pb2.Key`
164163
and
@@ -223,6 +222,8 @@ def lookup(self, dataset_id, key_pbs):
223222
def run_query(self, dataset_id, query_pb, namespace=None):
224223
"""Run a query on the Cloud Datastore.
225224
225+
Maps the ``DatastoreService.RunQuery`` protobuf RPC.
226+
226227
Given a Query protobuf,
227228
sends a ``runQuery`` request to the Cloud Datastore API
228229
and returns a list of entity protobufs matching the query.
@@ -277,6 +278,8 @@ def run_query(self, dataset_id, query_pb, namespace=None):
277278
def begin_transaction(self, dataset_id, serializable=False):
278279
"""Begin a transaction.
279280
281+
Maps the ``DatastoreService.BeginTransaction`` protobuf RPC.
282+
280283
:type dataset_id: string
281284
:param dataset_id: The dataset over which to execute the transaction.
282285
"""
@@ -302,6 +305,8 @@ def begin_transaction(self, dataset_id, serializable=False):
302305
def commit(self, dataset_id, mutation_pb):
303306
"""Commit dataset mutations in context of current transation (if any).
304307
308+
Maps the ``DatastoreService.Commit`` protobuf RPC.
309+
305310
:type dataset_id: string
306311
:param dataset_id: The dataset in which to perform the changes.
307312
@@ -327,6 +332,8 @@ def commit(self, dataset_id, mutation_pb):
327332
def rollback(self, dataset_id):
328333
"""Rollback the connection's existing transaction.
329334
335+
Maps the ``DatastoreService.Rollback`` protobuf RPC.
336+
330337
Raises a ``ValueError``
331338
if the connection isn't currently in a transaction.
332339
@@ -345,6 +352,8 @@ def rollback(self, dataset_id):
345352
def allocate_ids(self, dataset_id, key_pbs):
346353
"""Obtain backend-generated IDs for a set of keys.
347354
355+
Maps the ``DatastoreService.AllocateIds`` protobuf RPC.
356+
348357
:type dataset_id: string
349358
:param dataset_id: The dataset to which the transaction belongs.
350359
@@ -362,9 +371,6 @@ def allocate_ids(self, dataset_id, key_pbs):
362371
datastore_pb.AllocateIdsResponse)
363372
return list(response.key)
364373

365-
#
366-
# Entity-related helper methods.
367-
#
368374
def save_entity(self, dataset_id, key_pb, properties):
369375
"""Save an entity to the Cloud Datastore with the provided properties.
370376

0 commit comments

Comments
 (0)