def _assign_entity_to_pb(entity_pb, entity): """Copy ``entity`` into ``entity_pb``. Helper method for ``Batch.put``. :type entity_pb: :class:`gcloud.datastore._generated.entity_pb2.Entity` :param entity_pb: The entity owned by a mutation. :type entity: :class:`gcloud.datastore.entity.Entity` :param entity: The entity being updated within the batch / transaction. """ bare_entity_pb = helpers.entity_to_protobuf(entity) bare_entity_pb.key.CopyFrom(bare_entity_pb.key) entity_pb.CopyFrom(bare_entity_pb)
def _callFUT(self, entity): from gcloud.datastore.helpers import entity_to_protobuf return entity_to_protobuf(entity)