Skip to content

Commit 22941e2

Browse files
authored
Merge pull request #2579 from tswast/str-not-string
Replace types string with str.
2 parents 881a953 + 7b18887 commit 22941e2

File tree

62 files changed

+533
-533
lines changed

Some content is hidden

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

62 files changed

+533
-533
lines changed

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/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def list_datasets(self, include_all=False, max_results=None,
103103
See:
104104
https://cloud.google.com/bigquery/docs/reference/v2/datasets/list
105105
106-
:type include_all: boolean
106+
:type include_all: bool
107107
:param include_all: True if results include hidden datasets.
108108
109109
:type max_results: int
@@ -180,7 +180,7 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None,
180180
not passed, the API will return the first page of
181181
jobs.
182182
183-
:type all_users: boolean
183+
:type all_users: bool
184184
:param all_users: if true, include jobs owned by all users in the
185185
project.
186186

bigquery/google/cloud/bigquery/dataset.py

Lines changed: 17 additions & 17 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`
@@ -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')
@@ -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.
@@ -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')
@@ -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.
@@ -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')
@@ -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: 13 additions & 13 deletions
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
@@ -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`
@@ -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')
@@ -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: 6 additions & 6 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`
@@ -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
@@ -118,7 +118,7 @@ def cache_hit(self):
118118
See:
119119
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#cacheHit
120120
121-
:rtype: boolean or ``NoneType``
121+
:rtype: bool or ``NoneType``
122122
:returns: True if the query results were served from cache (None
123123
until set by the server).
124124
"""
@@ -131,7 +131,7 @@ def complete(self):
131131
See:
132132
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#jobComplete
133133
134-
:rtype: boolean or ``NoneType``
134+
:rtype: bool or ``NoneType``
135135
:returns: True if the query completed on the server (None
136136
until set by the server).
137137
"""
@@ -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')
@@ -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``

0 commit comments

Comments
 (0)