Skip to content

Commit 60862d1

Browse files
committed
Replace types string with str.
Uses command: ag -l 'type ([^:]+): string' | \ xargs gsed -r -i.bak -e 's/type ([^:]+): string/type \1: str/g' Note: [-r for gsed (GNU sed) is needed for group matching](http://superuser.com/a/336819/125262).
1 parent 01b494c commit 60862d1

54 files changed

Lines changed: 404 additions & 404 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bigquery/google/cloud/bigquery/_helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class _ConfigurationProperty(object):
108108
Values will be stored on a `_configuration` helper attribute of the
109109
property's job instance.
110110
111-
:type name: string
111+
:type name: str
112112
:param name: name of the property
113113
"""
114114

@@ -139,7 +139,7 @@ def __delete__(self, instance):
139139
class _TypedProperty(_ConfigurationProperty):
140140
"""Property implementation: validates based on value type.
141141
142-
:type name: string
142+
:type name: str
143143
:param name: name of the property
144144
145145
:type property_type: type or sequence of types
@@ -164,7 +164,7 @@ class _EnumProperty(_ConfigurationProperty):
164164
Subclasses must define ``ALLOWED`` as a class-level constant: it must
165165
be a sequence of strings.
166166
167-
:type name: string
167+
:type name: str
168168
:param name: name of the property.
169169
"""
170170
def _validate(self, value):

bigquery/google/cloud/bigquery/dataset.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class AccessGrant(object):
3131
3232
See https://cloud.google.com/bigquery/docs/reference/v2/datasets.
3333
34-
:type role: string
34+
:type role: str
3535
:param role: Role granted to the entity. One of
3636
3737
* ``'OWNER'``
@@ -40,11 +40,11 @@ class AccessGrant(object):
4040
4141
May also be ``None`` if the ``entity_type`` is ``view``.
4242
43-
:type entity_type: string
43+
:type entity_type: str
4444
:param entity_type: Type of entity being granted the role. One of
4545
:attr:`ENTITY_TYPES`.
4646
47-
:type entity_id: string
47+
:type entity_id: str
4848
:param entity_id: ID of entity being granted the role.
4949
5050
:raises: :class:`ValueError` if the ``entity_type`` is not among
@@ -91,7 +91,7 @@ class Dataset(object):
9191
See:
9292
https://cloud.google.com/bigquery/docs/reference/v2/datasets
9393
94-
:type name: string
94+
:type name: str
9595
:param name: the name of the dataset
9696
9797
:type client: :class:`google.cloud.bigquery.client.Client`
@@ -238,7 +238,7 @@ def description(self):
238238
def description(self, value):
239239
"""Update description of the dataset.
240240
241-
:type value: string, or ``NoneType``
241+
:type value: str, or ``NoneType``
242242
:param value: new description
243243
244244
:raises: ValueError for invalid value types.
@@ -260,7 +260,7 @@ def friendly_name(self):
260260
def friendly_name(self, value):
261261
"""Update title of the dataset.
262262
263-
:type value: string, or ``NoneType``
263+
:type value: str, or ``NoneType``
264264
:param value: new title
265265
266266
:raises: ValueError for invalid value types.
@@ -282,7 +282,7 @@ def location(self):
282282
def location(self, value):
283283
"""Update location in which the dataset is hosted.
284284
285-
:type value: string, or ``NoneType``
285+
:type value: str, or ``NoneType``
286286
:param value: new location
287287
288288
:raises: ValueError for invalid value types.
@@ -545,7 +545,7 @@ def list_tables(self, max_results=None, page_token=None):
545545
:param max_results: maximum number of tables to return, If not
546546
passed, defaults to a value set by the API.
547547
548-
:type page_token: string
548+
:type page_token: str
549549
:param page_token: opaque marker for the next "page" of datasets. If
550550
not passed, the API will return the first page of
551551
datasets.
@@ -575,7 +575,7 @@ def list_tables(self, max_results=None, page_token=None):
575575
def table(self, name, schema=()):
576576
"""Construct a table bound to this dataset.
577577
578-
:type name: string
578+
:type name: str
579579
:param name: Name of the table.
580580
581581
:type schema: list of :class:`google.cloud.bigquery.table.SchemaField`

bigquery/google/cloud/bigquery/job.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def _require_client(self, client):
120120
class _AsyncJob(_BaseJob):
121121
"""Base class for asynchronous jobs.
122122
123-
:type name: string
123+
:type name: str
124124
:param name: the name of the job
125125
126126
:type client: :class:`google.cloud.bigquery.client.Client`
@@ -399,7 +399,7 @@ class _LoadConfiguration(object):
399399
class LoadTableFromStorageJob(_AsyncJob):
400400
"""Asynchronous job for loading data into a table from CloudStorage.
401401
402-
:type name: string
402+
:type name: str
403403
:param name: the name of the job
404404
405405
:type destination: :class:`google.cloud.bigquery.table.Table`
@@ -648,7 +648,7 @@ class _CopyConfiguration(object):
648648
class CopyJob(_AsyncJob):
649649
"""Asynchronous job: copy data into a table from other tables.
650650
651-
:type name: string
651+
:type name: str
652652
:param name: the name of the job
653653
654654
:type destination: :class:`google.cloud.bigquery.table.Table`
@@ -763,7 +763,7 @@ class _ExtractConfiguration(object):
763763
class ExtractTableToStorageJob(_AsyncJob):
764764
"""Asynchronous job: extract data from a table into Cloud Storage.
765765
766-
:type name: string
766+
:type name: str
767767
:param name: the name of the job
768768
769769
:type source: :class:`google.cloud.bigquery.table.Table`
@@ -894,10 +894,10 @@ class _AsyncQueryConfiguration(object):
894894
class QueryJob(_AsyncJob):
895895
"""Asynchronous job: query tables.
896896
897-
:type name: string
897+
:type name: str
898898
:param name: the name of the job
899899
900-
:type query: string
900+
:type query: str
901901
:param query: SQL query string
902902
903903
:type client: :class:`google.cloud.bigquery.client.Client`

bigquery/google/cloud/bigquery/query.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class _SyncQueryConfiguration(object):
4242
class QueryResults(object):
4343
"""Synchronous job: query tables.
4444
45-
:type query: string
45+
:type query: str
4646
:param query: SQL query string
4747
4848
:type client: :class:`google.cloud.bigquery.client.Client`
@@ -348,7 +348,7 @@ def fetch_data(self, max_results=None, page_token=None, start_index=None,
348348
:type max_results: integer or ``NoneType``
349349
:param max_results: maximum number of rows to return.
350350
351-
:type page_token: string or ``NoneType``
351+
:type page_token: str or ``NoneType``
352352
:param page_token: token representing a cursor into the table's rows.
353353
354354
:type start_index: integer or ``NoneType``

bigtable/google/cloud/bigtable/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def instance(self, instance_id, location=_EXISTING_INSTANCE_LOCATION_ID,
317317
:type instance_id: str
318318
:param instance_id: The ID of the instance.
319319
320-
:type location: string
320+
:type location: str
321321
:param location: location name, in form
322322
``projects/<project>/locations/<location>``; used to
323323
set up the instance's cluster.

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.

core/google/cloud/connection.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,19 @@ 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.
@@ -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

core/google/cloud/credentials.py

Lines changed: 2 additions & 2 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

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

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

0 commit comments

Comments
 (0)