Skip to content

Commit 437109a

Browse files
authored
Merge pull request #2579 from tswast/str-not-string
Replace types string with str.
2 parents 7f8dd27 + 32b3d84 commit 437109a

File tree

7 files changed

+66
-66
lines changed

7 files changed

+66
-66
lines changed

packages/google-cloud-datastore/google/cloud/datastore/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ def _determine_default_project(project=None):
5050
* Google App Engine application ID
5151
* Google Compute Engine project ID (from metadata server)
5252
53-
:type project: string
53+
:type project: str
5454
:param project: Optional. The project to use as default.
5555
56-
:rtype: string or ``NoneType``
56+
:rtype: str or ``NoneType``
5757
:returns: Default project if it can be determined.
5858
"""
5959
if project is None:
@@ -75,7 +75,7 @@ def _extended_lookup(connection, project, key_pbs,
7575
:type connection: :class:`google.cloud.datastore.connection.Connection`
7676
:param connection: The connection used to connect to datastore.
7777
78-
:type project: string
78+
:type project: str
7979
:param project: The project to make the request for.
8080
8181
:type key_pbs: list of :class:`._generated.entity_pb2.Key`
@@ -95,7 +95,7 @@ def _extended_lookup(connection, project, key_pbs,
9595
consistency. If True, request ``EVENTUAL`` read
9696
consistency.
9797
98-
:type transaction_id: string
98+
:type transaction_id: str
9999
:param transaction_id: If passed, make the request in the scope of
100100
the given transaction. Incompatible with
101101
``eventual==True``.
@@ -146,10 +146,10 @@ def _extended_lookup(connection, project, key_pbs,
146146
class Client(_BaseClient, _ClientProjectMixin):
147147
"""Convenience wrapper for invoking APIs/factories w/ a project.
148148
149-
:type project: string
149+
:type project: str
150150
:param project: (optional) The project to pass to proxied API methods.
151151
152-
:type namespace: string
152+
:type namespace: str
153153
:param namespace: (optional) namespace to pass to proxied API methods.
154154
155155
:type credentials: :class:`oauth2client.client.OAuth2Credentials` or

packages/google-cloud-datastore/google/cloud/datastore/connection.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,18 @@ def __init__(self, connection):
6565
def _request(self, project, method, data):
6666
"""Make a request over the Http transport to the Cloud Datastore API.
6767
68-
:type project: string
68+
:type project: str
6969
:param project: The project to make the request for.
7070
71-
:type method: string
71+
:type method: str
7272
:param method: The API call method name (ie, ``runQuery``,
7373
``lookup``, etc)
7474
75-
:type data: string
75+
:type data: str
7676
:param data: The data to send with the API call.
7777
Typically this is a serialized Protobuf string.
7878
79-
:rtype: string
79+
:rtype: str
8080
:returns: The string response content from the API call.
8181
:raises: :class:`google.cloud.exceptions.GoogleCloudError` if the
8282
response code is not 200 OK.
@@ -100,11 +100,11 @@ def _request(self, project, method, data):
100100
def _rpc(self, project, method, request_pb, response_pb_cls):
101101
"""Make a protobuf RPC request.
102102
103-
:type project: string
103+
:type project: str
104104
:param project: The project to connect to. This is
105105
usually your project name in the cloud console.
106106
107-
:type method: string
107+
:type method: str
108108
:param method: The name of the method to invoke.
109109
110110
:type request_pb: :class:`google.protobuf.message.Message` instance
@@ -125,7 +125,7 @@ def _rpc(self, project, method, request_pb, response_pb_cls):
125125
def lookup(self, project, request_pb):
126126
"""Perform a ``lookup`` request.
127127
128-
:type project: string
128+
:type project: str
129129
:param project: The project to connect to. This is
130130
usually your project name in the cloud console.
131131
@@ -141,7 +141,7 @@ def lookup(self, project, request_pb):
141141
def run_query(self, project, request_pb):
142142
"""Perform a ``runQuery`` request.
143143
144-
:type project: string
144+
:type project: str
145145
:param project: The project to connect to. This is
146146
usually your project name in the cloud console.
147147
@@ -157,7 +157,7 @@ def run_query(self, project, request_pb):
157157
def begin_transaction(self, project, request_pb):
158158
"""Perform a ``beginTransaction`` request.
159159
160-
:type project: string
160+
:type project: str
161161
:param project: The project to connect to. This is
162162
usually your project name in the cloud console.
163163
@@ -174,7 +174,7 @@ def begin_transaction(self, project, request_pb):
174174
def commit(self, project, request_pb):
175175
"""Perform a ``commit`` request.
176176
177-
:type project: string
177+
:type project: str
178178
:param project: The project to connect to. This is
179179
usually your project name in the cloud console.
180180
@@ -190,7 +190,7 @@ def commit(self, project, request_pb):
190190
def rollback(self, project, request_pb):
191191
"""Perform a ``rollback`` request.
192192
193-
:type project: string
193+
:type project: str
194194
:param project: The project to connect to. This is
195195
usually your project name in the cloud console.
196196
@@ -206,7 +206,7 @@ def rollback(self, project, request_pb):
206206
def allocate_ids(self, project, request_pb):
207207
"""Perform an ``allocateIds`` request.
208208
209-
:type project: string
209+
:type project: str
210210
:param project: The project to connect to. This is
211211
usually your project name in the cloud console.
212212
@@ -249,7 +249,7 @@ def __init__(self, connection, secure):
249249
def lookup(self, project, request_pb):
250250
"""Perform a ``lookup`` request.
251251
252-
:type project: string
252+
:type project: str
253253
:param project: The project to connect to. This is
254254
usually your project name in the cloud console.
255255
@@ -265,7 +265,7 @@ def lookup(self, project, request_pb):
265265
def run_query(self, project, request_pb):
266266
"""Perform a ``runQuery`` request.
267267
268-
:type project: string
268+
:type project: str
269269
:param project: The project to connect to. This is
270270
usually your project name in the cloud console.
271271
@@ -287,7 +287,7 @@ def run_query(self, project, request_pb):
287287
def begin_transaction(self, project, request_pb):
288288
"""Perform a ``beginTransaction`` request.
289289
290-
:type project: string
290+
:type project: str
291291
:param project: The project to connect to. This is
292292
usually your project name in the cloud console.
293293
@@ -304,7 +304,7 @@ def begin_transaction(self, project, request_pb):
304304
def commit(self, project, request_pb):
305305
"""Perform a ``commit`` request.
306306
307-
:type project: string
307+
:type project: str
308308
:param project: The project to connect to. This is
309309
usually your project name in the cloud console.
310310
@@ -328,7 +328,7 @@ def commit(self, project, request_pb):
328328
def rollback(self, project, request_pb):
329329
"""Perform a ``rollback`` request.
330330
331-
:type project: string
331+
:type project: str
332332
:param project: The project to connect to. This is
333333
usually your project name in the cloud console.
334334
@@ -344,7 +344,7 @@ def rollback(self, project, request_pb):
344344
def allocate_ids(self, project, request_pb):
345345
"""Perform an ``allocateIds`` request.
346346
347-
:type project: string
347+
:type project: str
348348
:param project: The project to connect to. This is
349349
usually your project name in the cloud console.
350350
@@ -407,18 +407,18 @@ def build_api_url(self, project, method, base_url=None,
407407
This method is used internally to come up with the URL to use when
408408
making RPCs to the Cloud Datastore API.
409409
410-
:type project: string
410+
:type project: str
411411
:param project: The project to connect to. This is
412412
usually your project name in the cloud console.
413413
414-
:type method: string
414+
:type method: str
415415
:param method: The API method to call (e.g. 'runQuery', 'lookup').
416416
417-
:type base_url: string
417+
:type base_url: str
418418
:param base_url: The base URL where the API lives.
419419
You shouldn't have to provide this.
420420
421-
:type api_version: string
421+
:type api_version: str
422422
:param api_version: The version of the API to connect to.
423423
You shouldn't have to provide this.
424424
@@ -453,7 +453,7 @@ def lookup(self, project, key_pbs,
453453
>>> connection.lookup('project', [key.to_protobuf()])
454454
[<Entity protobuf>]
455455
456-
:type project: string
456+
:type project: str
457457
:param project: The project to look up the keys in.
458458
459459
:type key_pbs: list of
@@ -465,7 +465,7 @@ def lookup(self, project, key_pbs,
465465
consistency. If True, request ``EVENTUAL`` read
466466
consistency.
467467
468-
:type transaction_id: string
468+
:type transaction_id: str
469469
:param transaction_id: If passed, make the request in the scope of
470470
the given transaction. Incompatible with
471471
``eventual==True``.
@@ -504,21 +504,21 @@ def run_query(self, project, query_pb, namespace=None,
504504
Under the hood, the :class:`google.cloud.datastore.query.Query` class
505505
uses this method to fetch data.
506506
507-
:type project: string
507+
:type project: str
508508
:param project: The project over which to run the query.
509509
510510
:type query_pb: :class:`.datastore._generated.query_pb2.Query`
511511
:param query_pb: The Protobuf representing the query to run.
512512
513-
:type namespace: string
513+
:type namespace: str
514514
:param namespace: The namespace over which to run the query.
515515
516516
:type eventual: bool
517517
:param eventual: If False (the default), request ``STRONG`` read
518518
consistency. If True, request ``EVENTUAL`` read
519519
consistency.
520520
521-
:type transaction_id: string
521+
:type transaction_id: str
522522
:param transaction_id: If passed, make the request in the scope of
523523
the given transaction. Incompatible with
524524
``eventual==True``.
@@ -548,7 +548,7 @@ def begin_transaction(self, project):
548548
549549
Maps the ``DatastoreService.BeginTransaction`` protobuf RPC.
550550
551-
:type project: string
551+
:type project: str
552552
:param project: The project to which the transaction applies.
553553
554554
:rtype: bytes
@@ -563,13 +563,13 @@ def commit(self, project, request, transaction_id):
563563
564564
Maps the ``DatastoreService.Commit`` protobuf RPC.
565565
566-
:type project: string
566+
:type project: str
567567
:param project: The project to which the transaction applies.
568568
569569
:type request: :class:`._generated.datastore_pb2.CommitRequest`
570570
:param request: The protobuf with the mutations being committed.
571571
572-
:type transaction_id: string or None
572+
:type transaction_id: str or None
573573
:param transaction_id: The transaction ID returned from
574574
:meth:`begin_transaction`. Non-transactional
575575
batches must pass ``None``.
@@ -597,10 +597,10 @@ def rollback(self, project, transaction_id):
597597
598598
Maps the ``DatastoreService.Rollback`` protobuf RPC.
599599
600-
:type project: string
600+
:type project: str
601601
:param project: The project to which the transaction belongs.
602602
603-
:type transaction_id: string
603+
:type transaction_id: str
604604
:param transaction_id: The transaction ID returned from
605605
:meth:`begin_transaction`.
606606
"""
@@ -614,7 +614,7 @@ def allocate_ids(self, project, key_pbs):
614614
615615
Maps the ``DatastoreService.AllocateIds`` protobuf RPC.
616616
617-
:type project: string
617+
:type project: str
618618
:param project: The project to which the transaction belongs.
619619
620620
:type key_pbs: list of

packages/google-cloud-datastore/google/cloud/datastore/entity.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def __eq__(self, other):
9191
Entities compare equal if their keys compare equal and their
9292
properties compare equal.
9393
94-
:rtype: boolean
94+
:rtype: bool
9595
:returns: True if the entities compare equal, else False.
9696
"""
9797
if not isinstance(other, Entity):
@@ -108,7 +108,7 @@ def __ne__(self, other):
108108
Entities compare equal if their keys compare equal and their
109109
properties compare equal.
110110
111-
:rtype: boolean
111+
:rtype: bool
112112
:returns: False if the entities compare equal, else True.
113113
"""
114114
return not self.__eq__(other)

packages/google-cloud-datastore/google/cloud/datastore/helpers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def _new_value_pb(entity_pb, name):
8080
:type entity_pb: :class:`.datastore._generated.entity_pb2.Entity`
8181
:param entity_pb: An entity protobuf to add a new property to.
8282
83-
:type name: string
83+
:type name: str
8484
:param name: The name of the new property.
8585
8686
:rtype: :class:`google.cloud.datastore._generated.entity_pb2.Value`
@@ -162,7 +162,7 @@ def _set_pb_meaning_from_entity(entity, name, value, value_pb,
162162
:type entity: :class:`google.cloud.datastore.entity.Entity`
163163
:param entity: The entity to be turned into a protobuf.
164164
165-
:type name: string
165+
:type name: str
166166
:param name: The name of the property.
167167
168168
:type value: object
@@ -452,7 +452,7 @@ def to_protobuf(self):
452452
def __eq__(self, other):
453453
"""Compare two geo points for equality.
454454
455-
:rtype: boolean
455+
:rtype: bool
456456
:returns: True if the points compare equal, else False.
457457
"""
458458
if not isinstance(other, GeoPoint):
@@ -464,7 +464,7 @@ def __eq__(self, other):
464464
def __ne__(self, other):
465465
"""Compare two geo points for inequality.
466466
467-
:rtype: boolean
467+
:rtype: bool
468468
:returns: False if the points compare equal, else True.
469469
"""
470470
return not self.__eq__(other)

0 commit comments

Comments
 (0)