2020from gcloud .environment_vars import GCD_HOST
2121from gcloud .exceptions import make_exception
2222from gcloud .datastore import _datastore_v1_pb2 as datastore_pb
23+ from gcloud .datastore import _entity_pb2
2324
2425
2526class Connection (connection .Connection ):
@@ -150,8 +151,8 @@ def lookup(self, dataset_id, key_pbs,
150151 Maps the ``DatastoreService.Lookup`` protobuf RPC.
151152
152153 This method deals only with protobufs
153- (:class:`gcloud.datastore._datastore_v1_pb2 .Key` and
154- :class:`gcloud.datastore._datastore_v1_pb2 .Entity`) and is used
154+ (:class:`gcloud.datastore._entity_pb2 .Key` and
155+ :class:`gcloud.datastore._entity_pb2 .Entity`) and is used
155156 under the hood in :func:`gcloud.datastore.get`:
156157
157158 >>> from gcloud import datastore
@@ -167,7 +168,7 @@ def lookup(self, dataset_id, key_pbs,
167168 :type dataset_id: string
168169 :param dataset_id: The ID of the dataset to look up the keys.
169170
170- :type key_pbs: list of :class:`gcloud.datastore._datastore_v1_pb2 .Key`
171+ :type key_pbs: list of :class:`gcloud.datastore._entity_pb2 .Key`
171172 :param key_pbs: The keys to retrieve from the datastore.
172173
173174 :type eventual: boolean
@@ -183,9 +184,9 @@ def lookup(self, dataset_id, key_pbs,
183184 :rtype: tuple
184185 :returns: A triple of (``results``, ``missing``, ``deferred``) where
185186 both ``results`` and ``missing`` are lists of
186- :class:`gcloud.datastore._datastore_v1_pb2 .Entity` and
187+ :class:`gcloud.datastore._entity_pb2 .Entity` and
187188 ``deferred`` is a list of
188- :class:`gcloud.datastore._datastore_v1_pb2 .Key`.
189+ :class:`gcloud.datastore._entity_pb2 .Key`.
189190 """
190191 lookup_request = datastore_pb .LookupRequest ()
191192 _set_read_options (lookup_request , eventual , transaction_id )
@@ -360,10 +361,10 @@ def allocate_ids(self, dataset_id, key_pbs):
360361 :param dataset_id: The ID of the dataset to which the transaction
361362 belongs.
362363
363- :type key_pbs: list of :class:`gcloud.datastore._datastore_v1_pb2 .Key`
364+ :type key_pbs: list of :class:`gcloud.datastore._entity_pb2 .Key`
364365 :param key_pbs: The keys for which the backend should allocate IDs.
365366
366- :rtype: list of :class:`gcloud.datastore._datastore_v1_pb2 .Key`
367+ :rtype: list of :class:`gcloud.datastore._entity_pb2 .Key`
367368 :returns: An equal number of keys, with IDs filled in by the backend.
368369 """
369370 request = datastore_pb .AllocateIdsRequest ()
@@ -399,15 +400,15 @@ def _prepare_key_for_request(key_pb): # pragma: NO COVER copied from helpers
399400 This is copied from `helpers` to avoid a cycle:
400401 _implicit_environ -> connection -> helpers -> key -> _implicit_environ
401402
402- :type key_pb: :class:`gcloud.datastore._datastore_v1_pb2 .Key`
403+ :type key_pb: :class:`gcloud.datastore._entity_pb2 .Key`
403404 :param key_pb: A key to be added to a request.
404405
405- :rtype: :class:`gcloud.datastore._datastore_v1_pb2 .Key`
406+ :rtype: :class:`gcloud.datastore._entity_pb2 .Key`
406407 :returns: A key which will be added to a request. It will be the
407408 original if nothing needs to be changed.
408409 """
409410 if key_pb .partition_id .HasField ('dataset_id' ):
410- new_key_pb = datastore_pb .Key ()
411+ new_key_pb = _entity_pb2 .Key ()
411412 new_key_pb .CopyFrom (key_pb )
412413 new_key_pb .partition_id .ClearField ('dataset_id' )
413414 key_pb = new_key_pb
@@ -420,7 +421,7 @@ def _add_keys_to_request(request_field_pb, key_pbs):
420421 :type request_field_pb: `RepeatedCompositeFieldContainer`
421422 :param request_field_pb: A repeated proto field that contains keys.
422423
423- :type key_pbs: list of :class:`gcloud.datastore._datastore_v1_pb2 .Key`
424+ :type key_pbs: list of :class:`gcloud.datastore._entity_pb2 .Key`
424425 :param key_pbs: The keys to add to a request.
425426 """
426427 for key_pb in key_pbs :
0 commit comments