Skip to content

Commit 2dd9324

Browse files
authored
Merge pull request #2579 from tswast/str-not-string
Replace types string with str.
2 parents 86f60f7 + 59811e5 commit 2dd9324

File tree

11 files changed

+65
-65
lines changed

11 files changed

+65
-65
lines changed

packages/google-cloud-core/google/cloud/_helpers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def _datetime_to_rfc3339(value, ignore_zone=True):
438438
:type value: :class:`datetime.datetime`
439439
:param value: The datetime object to be converted to a string.
440440
441-
:type ignore_zone: boolean
441+
:type ignore_zone: bool
442442
:param ignore_zone: If True, then the timezone (if any) of the datetime
443443
object is ignored.
444444
@@ -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)

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class _ClientFactoryMixin(object):
3434
def from_service_account_json(cls, json_credentials_path, *args, **kwargs):
3535
"""Factory to retrieve JSON credentials while creating client.
3636
37-
:type json_credentials_path: string
37+
:type json_credentials_path: str
3838
:param json_credentials_path: The path to a private key file (this file
3939
was given to you when you created the
4040
service account). This file must contain
@@ -69,10 +69,10 @@ def from_service_account_p12(cls, client_email, private_key_path,
6969
Unless you have an explicit reason to use a PKCS12 key for your
7070
service account, we recommend using a JSON key.
7171
72-
:type client_email: string
72+
:type client_email: str
7373
:param client_email: The e-mail attached to the service account.
7474
75-
:type private_key_path: string
75+
:type private_key_path: str
7676
:param private_key_path: The path to a private key file (this file was
7777
given to you when you created the service
7878
account). This file must be in P12 format.
@@ -127,7 +127,7 @@ def __init__(self, credentials=None, http=None):
127127
class _ClientProjectMixin(object):
128128
"""Mixin to allow setting the project on the client.
129129
130-
:type project: string
130+
:type project: str
131131
:param project: the project which the client acts on behalf of. If not
132132
passed falls back to the default inferred from the
133133
environment.
@@ -160,7 +160,7 @@ class JSONClient(Client, _ClientProjectMixin):
160160
Assumes such APIs use the ``project`` and the client needs to store this
161161
value.
162162
163-
:type project: string
163+
:type project: str
164164
:param project: the project which the client acts on behalf of. If not
165165
passed falls back to the default inferred from the
166166
environment.

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,24 +162,24 @@ def build_api_url(cls, path, query_params=None,
162162
163163
Typically, you shouldn't need to use this method.
164164
165-
:type path: string
165+
:type path: str
166166
:param path: The path to the resource (ie, ``'/b/bucket-name'``).
167167
168168
:type query_params: dict or list
169169
:param query_params: A dictionary of keys and values (or list of
170170
key-value pairs) to insert into the query
171171
string of the URL.
172172
173-
:type api_base_url: string
173+
:type api_base_url: str
174174
:param api_base_url: The base URL for the API endpoint.
175175
Typically you won't have to provide this.
176176
177-
:type api_version: string
177+
:type api_version: str
178178
:param api_version: The version of the API to call.
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(
@@ -199,16 +199,16 @@ def _make_request(self, method, url, data=None, content_type=None,
199199
200200
Typically, you shouldn't need to use this method.
201201
202-
:type method: string
202+
:type method: str
203203
:param method: The HTTP method to use in the request.
204204
205-
:type url: string
205+
:type url: str
206206
:param url: The URL to send the request to.
207207
208-
:type data: string
208+
:type data: str
209209
:param data: The data to send as the body of the request.
210210
211-
:type content_type: string
211+
:type content_type: str
212212
:param content_type: The proper MIME type of the data provided.
213213
214214
:type headers: dict
@@ -249,16 +249,16 @@ def _do_request(self, method, url, headers, data,
249249
250250
Allows batch context managers to override and defer a request.
251251
252-
:type method: string
252+
:type method: str
253253
:param method: The HTTP method to use in the request.
254254
255-
:type url: string
255+
:type url: str
256256
:param url: The URL to send the request to.
257257
258258
:type headers: dict
259259
:param headers: A dictionary of HTTP headers to send with the request.
260260
261-
:type data: string
261+
:type data: str
262262
:param data: The data to send as the body of the request.
263263
264264
:type target_object: object or :class:`NoneType`
@@ -282,11 +282,11 @@ def api_request(self, method, path, query_params=None,
282282
interact with the API using these primitives, this is the
283283
correct one to use.
284284
285-
:type method: string
285+
:type method: str
286286
:param method: The HTTP method name (ie, ``GET``, ``POST``, etc).
287287
Required.
288288
289-
:type path: string
289+
:type path: str
290290
:param path: The path to the resource (ie, ``'/b/bucket-name'``).
291291
Required.
292292
@@ -295,23 +295,23 @@ def api_request(self, method, path, query_params=None,
295295
key-value pairs) to insert into the query
296296
string of the URL.
297297
298-
:type data: string
298+
:type data: str
299299
:param data: The data to send as the body of the request. Default is
300300
the empty string.
301301
302-
:type content_type: string
302+
:type content_type: str
303303
:param content_type: The proper MIME type of the data provided. Default
304304
is None.
305305
306306
:type headers: dict
307307
:param headers: extra HTTP headers to be sent with the request.
308308
309-
:type api_base_url: string
309+
:type api_base_url: str
310310
:param api_base_url: The base URL for the API endpoint.
311311
Typically you won't have to provide this.
312312
Default is the standard API base URL.
313313
314-
:type api_version: string
314+
:type api_version: str
315315
:param api_version: The version of the API to call. Typically
316316
you shouldn't provide this and instead use
317317
the default for the library. Default is the

packages/google-cloud-core/google/cloud/credentials.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _get_signed_query_params(credentials, expiration, string_to_sign):
9797
:type expiration: int or long
9898
:param expiration: When the signed URL should expire.
9999
100-
:type string_to_sign: string
100+
:type string_to_sign: str
101101
:param string_to_sign: The string to be signed by the credentials.
102102
103103
:raises AttributeError: If :meth: sign_blob is unavailable.
@@ -184,7 +184,7 @@ def generate_signed_url(credentials, resource, expiration,
184184
:param credentials: Credentials object with an associated private key to
185185
sign text.
186186
187-
:type resource: string
187+
:type resource: str
188188
:param resource: A pointer to a specific resource
189189
(typically, ``/bucket-name/path/to/blob.txt``).
190190
@@ -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
"""

packages/google-cloud-core/google/cloud/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,10 @@ def make_exception(response, content, error_info=None, use_json=True):
184184
:param response: A response object that defines a status code as the
185185
status attribute.
186186
187-
:type content: string or dictionary
187+
:type content: str or dictionary
188188
:param content: The body of the HTTP error response.
189189
190-
:type error_info: string
190+
:type error_info: str
191191
:param error_info: Optional string giving extra information about the
192192
failed request.
193193

packages/google-cloud-core/google/cloud/iterator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def next(self):
345345
def _has_next_page(self):
346346
"""Determines whether or not there are more pages with results.
347347
348-
:rtype: boolean
348+
:rtype: bool
349349
:returns: Whether the iterator has more pages.
350350
"""
351351
if self.page_number == 0:

packages/google-cloud-core/google/cloud/streaming/buffered_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __len__(self):
5555
def stream_exhausted(self):
5656
"""Does the stream have bytes remaining beyond the buffer
5757
58-
:rtype: boolean
58+
:rtype: bool
5959
:returns: Boolean indicating if the stream is exhausted.
6060
"""
6161
return self._stream_at_end

packages/google-cloud-core/google/cloud/streaming/exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class HttpError(CommunicationError):
3232
:type content: bytes
3333
:param content: payload of the response which returned the error
3434
35-
:type url: string
35+
:type url: str
3636
:param url: URL of the response which returned the error
3737
"""
3838
def __init__(self, response, content, url):
@@ -94,7 +94,7 @@ class RetryAfterError(HttpError):
9494
:type content: bytes
9595
:param content: payload of the response which returned the error.
9696
97-
:type url: string
97+
:type url: str
9898
:param url: URL of the response which returned the error.
9999
100100
:type retry_after: integer

packages/google-cloud-core/google/cloud/streaming/http_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def retry_after(self):
258258
def is_redirect(self):
259259
"""Does this response contain a redirect
260260
261-
:rtype: boolean
261+
:rtype: bool
262262
:returns: True if the status code indicates a redirect and the
263263
'location' header is present.
264264
"""

0 commit comments

Comments
 (0)