Skip to content

Commit 01b494c

Browse files
committed
Replace string with str in rtypes.
Used the command: ag -l 'rtype: string' | xargs sed -i .bak 's/rtype: string/rtype: str/g' Based on this comment: googleapis#2485 (comment) `str` is a type, `string` is a module.
1 parent 881a953 commit 01b494c

File tree

21 files changed

+75
-75
lines changed

21 files changed

+75
-75
lines changed

bigquery/google/cloud/bigquery/dataset.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def __init__(self, name, client, access_grants=()):
115115
def project(self):
116116
"""Project bound to the dataset.
117117
118-
:rtype: string
118+
:rtype: str
119119
:returns: the project (derived from the client).
120120
"""
121121
return self._client.project
@@ -124,7 +124,7 @@ def project(self):
124124
def path(self):
125125
"""URL path for the dataset's APIs.
126126
127-
:rtype: string
127+
:rtype: str
128128
:returns: the path based on project and dataste name.
129129
"""
130130
return '/projects/%s/datasets/%s' % (self.project, self.name)
@@ -168,7 +168,7 @@ def created(self):
168168
def dataset_id(self):
169169
"""ID for the dataset resource.
170170
171-
:rtype: string, or ``NoneType``
171+
:rtype: str, or ``NoneType``
172172
:returns: the ID (None until set from the server).
173173
"""
174174
return self._properties.get('id')
@@ -177,7 +177,7 @@ def dataset_id(self):
177177
def etag(self):
178178
"""ETag for the dataset resource.
179179
180-
:rtype: string, or ``NoneType``
180+
:rtype: str, or ``NoneType``
181181
:returns: the ETag (None until set from the server).
182182
"""
183183
return self._properties.get('etag')
@@ -198,7 +198,7 @@ def modified(self):
198198
def self_link(self):
199199
"""URL for the dataset resource.
200200
201-
:rtype: string, or ``NoneType``
201+
:rtype: str, or ``NoneType``
202202
:returns: the URL (None until set from the server).
203203
"""
204204
return self._properties.get('selfLink')
@@ -229,7 +229,7 @@ def default_table_expiration_ms(self, value):
229229
def description(self):
230230
"""Description of the dataset.
231231
232-
:rtype: string, or ``NoneType``
232+
:rtype: str, or ``NoneType``
233233
:returns: The description as set by the user, or None (the default).
234234
"""
235235
return self._properties.get('description')
@@ -251,7 +251,7 @@ def description(self, value):
251251
def friendly_name(self):
252252
"""Title of the dataset.
253253
254-
:rtype: string, or ``NoneType``
254+
:rtype: str, or ``NoneType``
255255
:returns: The name as set by the user, or None (the default).
256256
"""
257257
return self._properties.get('friendlyName')
@@ -273,7 +273,7 @@ def friendly_name(self, value):
273273
def location(self):
274274
"""Location in which the dataset is hosted.
275275
276-
:rtype: string, or ``NoneType``
276+
:rtype: str, or ``NoneType``
277277
:returns: The location as set by the user, or None (the default).
278278
"""
279279
return self._properties.get('location')

bigquery/google/cloud/bigquery/job.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def __init__(self, client):
9696
def project(self):
9797
"""Project bound to the job.
9898
99-
:rtype: string
99+
:rtype: str
100100
:returns: the project (derived from the client).
101101
"""
102102
return self._client.project
@@ -135,7 +135,7 @@ def __init__(self, name, client):
135135
def job_type(self):
136136
"""Type of job
137137
138-
:rtype: string
138+
:rtype: str
139139
:returns: one of 'load', 'copy', 'extract', 'query'
140140
"""
141141
return self._JOB_TYPE
@@ -144,7 +144,7 @@ def job_type(self):
144144
def path(self):
145145
"""URL path for the job's APIs.
146146
147-
:rtype: string
147+
:rtype: str
148148
:returns: the path based on project and job name.
149149
"""
150150
return '/projects/%s/jobs/%s' % (self.project, self.name)
@@ -153,7 +153,7 @@ def path(self):
153153
def etag(self):
154154
"""ETag for the job resource.
155155
156-
:rtype: string, or ``NoneType``
156+
:rtype: str, or ``NoneType``
157157
:returns: the ETag (None until set from the server).
158158
"""
159159
return self._properties.get('etag')
@@ -162,7 +162,7 @@ def etag(self):
162162
def self_link(self):
163163
"""URL for the job resource.
164164
165-
:rtype: string, or ``NoneType``
165+
:rtype: str, or ``NoneType``
166166
:returns: the URL (None until set from the server).
167167
"""
168168
return self._properties.get('selfLink')
@@ -171,7 +171,7 @@ def self_link(self):
171171
def user_email(self):
172172
"""E-mail address of user who submitted the job.
173173
174-
:rtype: string, or ``NoneType``
174+
:rtype: str, or ``NoneType``
175175
:returns: the URL (None until set from the server).
176176
"""
177177
return self._properties.get('user_email')
@@ -241,7 +241,7 @@ def errors(self):
241241
def state(self):
242242
"""Status of the job.
243243
244-
:rtype: string, or ``NoneType``
244+
:rtype: str, or ``NoneType``
245245
:returns: the state (None until set from the server).
246246
"""
247247
status = self._properties.get('status')

bigquery/google/cloud/bigquery/query.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def from_query_job(cls, job):
9191
def project(self):
9292
"""Project bound to the job.
9393
94-
:rtype: string
94+
:rtype: str
9595
:returns: the project (derived from the client).
9696
"""
9797
return self._client.project
@@ -185,7 +185,7 @@ def page_token(self):
185185
See:
186186
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#pageToken
187187
188-
:rtype: string, or ``NoneType``
188+
:rtype: str, or ``NoneType``
189189
:returns: Token generated on the server (None until set by the server).
190190
"""
191191
return self._properties.get('pageToken')

core/google/cloud/_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ def _pb_timestamp_to_rfc3339(timestamp_pb):
526526
:type timestamp_pb: :class:`google.protobuf.timestamp_pb2.Timestamp`
527527
:param timestamp_pb: A Google returned timestamp protobuf.
528528
529-
:rtype: string
529+
:rtype: str
530530
:returns: An RFC 3339 formatted timestamp string.
531531
"""
532532
timestamp = _pb_timestamp_to_datetime(timestamp_pb)

core/google/cloud/connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def build_api_url(cls, path, query_params=None,
179179
Typically you shouldn't provide this and instead
180180
use the default for the library.
181181
182-
:rtype: string
182+
:rtype: str
183183
:returns: The URL assembled from the pieces provided.
184184
"""
185185
url = cls.API_URL_TEMPLATE.format(

core/google/cloud/credentials.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def generate_signed_url(credentials, resource, expiration,
220220
:param generation: (Optional) A value that indicates which generation of
221221
the resource to fetch.
222222
223-
:rtype: string
223+
:rtype: str
224224
:returns: A signed URL you can use to access the resource
225225
until expiration.
226226
"""

core/google/cloud/streaming/transfer.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def stream(self):
163163
def url(self):
164164
"""URL to / from which data is downloaded/uploaded.
165165
166-
:rtype: string
166+
:rtype: str
167167
:returns: The URL where data is sent/received.
168168
"""
169169
return self._url
@@ -318,7 +318,7 @@ def total_size(self):
318318
def encoding(self):
319319
"""'Content-Encoding' used to transfer the file
320320
321-
:rtype: string or None
321+
:rtype: str or None
322322
:returns: The encoding of the downloaded content.
323323
"""
324324
return self._encoding
@@ -732,7 +732,7 @@ def complete(self):
732732
def mime_type(self):
733733
"""MIMEtype of the file being uploaded.
734734
735-
:rtype: string
735+
:rtype: str
736736
:returns: The mime-type of the upload.
737737
"""
738738
return self._mime_type
@@ -750,7 +750,7 @@ def progress(self):
750750
def strategy(self):
751751
"""Upload strategy to use
752752
753-
:rtype: string or None
753+
:rtype: str or None
754754
:returns: The strategy used to upload the data.
755755
"""
756756
return self._strategy
@@ -972,7 +972,7 @@ def _get_range_header(response):
972972
:type response: :class:`google.cloud.streaming.http_wrapper.Response`
973973
:param response: response to be queried
974974
975-
:rtype: string
975+
:rtype: str
976976
:returns: The header used to determine the bytes range.
977977
"""
978978
# NOTE: Per RFC 2616[1]/7233[2][3], 'Range' is a request header,

datastore/google/cloud/datastore/client.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def _determine_default_project(project=None):
5353
:type project: string
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:

datastore/google/cloud/datastore/connection.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _request(self, project, method, data):
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.

datastore/google/cloud/datastore/key.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def is_partial(self):
269269
def namespace(self):
270270
"""Namespace getter.
271271
272-
:rtype: string
272+
:rtype: str
273273
:returns: The namespace of the current key.
274274
"""
275275
return self._namespace
@@ -298,7 +298,7 @@ def flat_path(self):
298298
def kind(self):
299299
"""Kind getter. Based on the last element of path.
300300
301-
:rtype: string
301+
:rtype: str
302302
:returns: The kind of the current key.
303303
"""
304304
return self.path[-1]['kind']
@@ -316,7 +316,7 @@ def id(self):
316316
def name(self):
317317
"""Name getter. Based on the last element of path.
318318
319-
:rtype: string
319+
:rtype: str
320320
:returns: The (string) name of the key.
321321
"""
322322
return self.path[-1].get('name')
@@ -335,7 +335,7 @@ def id_or_name(self):
335335
def project(self):
336336
"""Project getter.
337337
338-
:rtype: string
338+
:rtype: str
339339
:returns: The key's project.
340340
"""
341341
return self._project
@@ -391,7 +391,7 @@ def _validate_project(project, parent):
391391
:type parent: :class:`google.cloud.datastore.key.Key` or ``NoneType``
392392
:param parent: The parent of the key or ``None``.
393393
394-
:rtype: string
394+
:rtype: str
395395
:returns: The ``project`` passed in, or implied from the environment.
396396
:raises: :class:`ValueError` if ``project`` is ``None`` and no project
397397
can be inferred from the parent.

datastore/google/cloud/datastore/query.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def project(self):
109109
def namespace(self):
110110
"""This query's namespace
111111
112-
:rtype: string or None
112+
:rtype: str or None
113113
:returns: the namespace assigned to this query
114114
"""
115115
return self._namespace or self._client.namespace
@@ -128,7 +128,7 @@ def namespace(self, value):
128128
def kind(self):
129129
"""Get the Kind of the Query.
130130
131-
:rtype: string
131+
:rtype: str
132132
:returns: The kind for the query.
133133
"""
134134
return self._kind

datastore/google/cloud/datastore/transaction.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def __init__(self, client):
100100
def id(self):
101101
"""Getter for the transaction ID.
102102
103-
:rtype: string
103+
:rtype: str
104104
:returns: The ID of the current transaction.
105105
"""
106106
return self._id

dns/google/cloud/dns/changes.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _set_properties(self, resource):
7474
def path(self):
7575
"""URL path for change set APIs.
7676
77-
:rtype: string
77+
:rtype: str
7878
:returns: the path based on project, zone, and change set names.
7979
"""
8080
return '/projects/%s/managedZones/%s/changes/%s' % (
@@ -84,7 +84,7 @@ def path(self):
8484
def name(self):
8585
"""Name of the change set.
8686
87-
:rtype: string or ``NoneType``
87+
:rtype: str or ``NoneType``
8888
:returns: Name, as set by the back-end, or None.
8989
"""
9090
return self._properties.get('id')
@@ -104,7 +104,7 @@ def name(self, value):
104104
def status(self):
105105
"""Status of the change set.
106106
107-
:rtype: string or ``NoneType``
107+
:rtype: str or ``NoneType``
108108
:returns: Status, as set by the back-end, or None.
109109
"""
110110
return self._properties.get('status')

dns/google/cloud/dns/zone.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def from_api_repr(cls, resource, client):
8181
def project(self):
8282
"""Project bound to the zone.
8383
84-
:rtype: string
84+
:rtype: str
8585
:returns: the project (derived from the client).
8686
"""
8787
return self._client.project
@@ -90,7 +90,7 @@ def project(self):
9090
def path(self):
9191
"""URL path for the zone's APIs.
9292
93-
:rtype: string
93+
:rtype: str
9494
:returns: the path based on project and dataste name.
9595
"""
9696
return '/projects/%s/managedZones/%s' % (self.project, self.name)
@@ -117,7 +117,7 @@ def name_servers(self):
117117
def zone_id(self):
118118
"""ID for the zone resource.
119119
120-
:rtype: string, or ``NoneType``
120+
:rtype: str, or ``NoneType``
121121
:returns: the ID (None until set from the server).
122122
"""
123123
return self._properties.get('id')
@@ -126,7 +126,7 @@ def zone_id(self):
126126
def description(self):
127127
"""Description of the zone.
128128
129-
:rtype: string, or ``NoneType``
129+
:rtype: str, or ``NoneType``
130130
:returns: The description as set by the user, or None (the default).
131131
"""
132132
return self._properties.get('description')
@@ -153,7 +153,7 @@ def name_server_set(self):
153153
See:
154154
https://cloud.google.com/dns/api/v1/managedZones#nameServerSet
155155
156-
:rtype: string, or ``NoneType``
156+
:rtype: str, or ``NoneType``
157157
:returns: The name as set by the user, or None (the default).
158158
"""
159159
return self._properties.get('nameServerSet')

0 commit comments

Comments
 (0)