Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace types string with str. #2579

Merged
merged 4 commits into from
Oct 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bigquery/google/cloud/bigquery/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class _ConfigurationProperty(object):
Values will be stored on a `_configuration` helper attribute of the
property's job instance.

:type name: string
:type name: str
:param name: name of the property
"""

Expand Down Expand Up @@ -139,7 +139,7 @@ def __delete__(self, instance):
class _TypedProperty(_ConfigurationProperty):
"""Property implementation: validates based on value type.

:type name: string
:type name: str
:param name: name of the property

:type property_type: type or sequence of types
Expand All @@ -164,7 +164,7 @@ class _EnumProperty(_ConfigurationProperty):
Subclasses must define ``ALLOWED`` as a class-level constant: it must
be a sequence of strings.

:type name: string
:type name: str
:param name: name of the property.
"""
def _validate(self, value):
Expand Down
4 changes: 2 additions & 2 deletions bigquery/google/cloud/bigquery/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def list_datasets(self, include_all=False, max_results=None,
See:
https://cloud.google.com/bigquery/docs/reference/v2/datasets/list

:type include_all: boolean
:type include_all: bool
:param include_all: True if results include hidden datasets.

:type max_results: int
Expand Down Expand Up @@ -180,7 +180,7 @@ def list_jobs(self, max_results=None, page_token=None, all_users=None,
not passed, the API will return the first page of
jobs.

:type all_users: boolean
:type all_users: bool
:param all_users: if true, include jobs owned by all users in the
project.

Expand Down
34 changes: 17 additions & 17 deletions bigquery/google/cloud/bigquery/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AccessGrant(object):

See https://cloud.google.com/bigquery/docs/reference/v2/datasets.

:type role: string
:type role: str
:param role: Role granted to the entity. One of

* ``'OWNER'``
Expand All @@ -40,11 +40,11 @@ class AccessGrant(object):

May also be ``None`` if the ``entity_type`` is ``view``.

:type entity_type: string
:type entity_type: str
:param entity_type: Type of entity being granted the role. One of
:attr:`ENTITY_TYPES`.

:type entity_id: string
:type entity_id: str
:param entity_id: ID of entity being granted the role.

:raises: :class:`ValueError` if the ``entity_type`` is not among
Expand Down Expand Up @@ -91,7 +91,7 @@ class Dataset(object):
See:
https://cloud.google.com/bigquery/docs/reference/v2/datasets

:type name: string
:type name: str
:param name: the name of the dataset

:type client: :class:`google.cloud.bigquery.client.Client`
Expand All @@ -115,7 +115,7 @@ def __init__(self, name, client, access_grants=()):
def project(self):
"""Project bound to the dataset.

:rtype: string
:rtype: str
:returns: the project (derived from the client).
"""
return self._client.project
Expand All @@ -124,7 +124,7 @@ def project(self):
def path(self):
"""URL path for the dataset's APIs.

:rtype: string
:rtype: str
:returns: the path based on project and dataste name.
"""
return '/projects/%s/datasets/%s' % (self.project, self.name)
Expand Down Expand Up @@ -168,7 +168,7 @@ def created(self):
def dataset_id(self):
"""ID for the dataset resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

:returns: the ID (None until set from the server).
"""
return self._properties.get('id')
Expand All @@ -177,7 +177,7 @@ def dataset_id(self):
def etag(self):
"""ETag for the dataset resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ETag (None until set from the server).
"""
return self._properties.get('etag')
Expand All @@ -198,7 +198,7 @@ def modified(self):
def self_link(self):
"""URL for the dataset resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('selfLink')
Expand Down Expand Up @@ -229,7 +229,7 @@ def default_table_expiration_ms(self, value):
def description(self):
"""Description of the dataset.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The description as set by the user, or None (the default).
"""
return self._properties.get('description')
Expand All @@ -238,7 +238,7 @@ def description(self):
def description(self, value):
"""Update description of the dataset.

:type value: string, or ``NoneType``
:type value: str, or ``NoneType``
:param value: new description

:raises: ValueError for invalid value types.
Expand All @@ -251,7 +251,7 @@ def description(self, value):
def friendly_name(self):
"""Title of the dataset.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The name as set by the user, or None (the default).
"""
return self._properties.get('friendlyName')
Expand All @@ -260,7 +260,7 @@ def friendly_name(self):
def friendly_name(self, value):
"""Update title of the dataset.

:type value: string, or ``NoneType``
:type value: str, or ``NoneType``
:param value: new title

:raises: ValueError for invalid value types.
Expand All @@ -273,7 +273,7 @@ def friendly_name(self, value):
def location(self):
"""Location in which the dataset is hosted.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: The location as set by the user, or None (the default).
"""
return self._properties.get('location')
Expand All @@ -282,7 +282,7 @@ def location(self):
def location(self, value):
"""Update location in which the dataset is hosted.

:type value: string, or ``NoneType``
:type value: str, or ``NoneType``
:param value: new location

:raises: ValueError for invalid value types.
Expand Down Expand Up @@ -545,7 +545,7 @@ def list_tables(self, max_results=None, page_token=None):
:param max_results: maximum number of tables to return, If not
passed, defaults to a value set by the API.

:type page_token: string
:type page_token: str
:param page_token: opaque marker for the next "page" of datasets. If
not passed, the API will return the first page of
datasets.
Expand Down Expand Up @@ -575,7 +575,7 @@ def list_tables(self, max_results=None, page_token=None):
def table(self, name, schema=()):
"""Construct a table bound to this dataset.

:type name: string
:type name: str
:param name: Name of the table.

:type schema: list of :class:`google.cloud.bigquery.table.SchemaField`
Expand Down
26 changes: 13 additions & 13 deletions bigquery/google/cloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def __init__(self, client):
def project(self):
"""Project bound to the job.

:rtype: string
:rtype: str
:returns: the project (derived from the client).
"""
return self._client.project
Expand All @@ -120,7 +120,7 @@ def _require_client(self, client):
class _AsyncJob(_BaseJob):
"""Base class for asynchronous jobs.

:type name: string
:type name: str
:param name: the name of the job

:type client: :class:`google.cloud.bigquery.client.Client`
Expand All @@ -135,7 +135,7 @@ def __init__(self, name, client):
def job_type(self):
"""Type of job

:rtype: string
:rtype: str
:returns: one of 'load', 'copy', 'extract', 'query'
"""
return self._JOB_TYPE
Expand All @@ -144,7 +144,7 @@ def job_type(self):
def path(self):
"""URL path for the job's APIs.

:rtype: string
:rtype: str
:returns: the path based on project and job name.
"""
return '/projects/%s/jobs/%s' % (self.project, self.name)
Expand All @@ -153,7 +153,7 @@ def path(self):
def etag(self):
"""ETag for the job resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the ETag (None until set from the server).
"""
return self._properties.get('etag')
Expand All @@ -162,7 +162,7 @@ def etag(self):
def self_link(self):
"""URL for the job resource.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('selfLink')
Expand All @@ -171,7 +171,7 @@ def self_link(self):
def user_email(self):
"""E-mail address of user who submitted the job.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the URL (None until set from the server).
"""
return self._properties.get('user_email')
Expand Down Expand Up @@ -241,7 +241,7 @@ def errors(self):
def state(self):
"""Status of the job.

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: the state (None until set from the server).
"""
status = self._properties.get('status')
Expand Down Expand Up @@ -399,7 +399,7 @@ class _LoadConfiguration(object):
class LoadTableFromStorageJob(_AsyncJob):
"""Asynchronous job for loading data into a table from CloudStorage.

:type name: string
:type name: str
:param name: the name of the job

:type destination: :class:`google.cloud.bigquery.table.Table`
Expand Down Expand Up @@ -648,7 +648,7 @@ class _CopyConfiguration(object):
class CopyJob(_AsyncJob):
"""Asynchronous job: copy data into a table from other tables.

:type name: string
:type name: str
:param name: the name of the job

:type destination: :class:`google.cloud.bigquery.table.Table`
Expand Down Expand Up @@ -763,7 +763,7 @@ class _ExtractConfiguration(object):
class ExtractTableToStorageJob(_AsyncJob):
"""Asynchronous job: extract data from a table into Cloud Storage.

:type name: string
:type name: str
:param name: the name of the job

:type source: :class:`google.cloud.bigquery.table.Table`
Expand Down Expand Up @@ -894,10 +894,10 @@ class _AsyncQueryConfiguration(object):
class QueryJob(_AsyncJob):
"""Asynchronous job: query tables.

:type name: string
:type name: str
:param name: the name of the job

:type query: string
:type query: str
:param query: SQL query string

:type client: :class:`google.cloud.bigquery.client.Client`
Expand Down
12 changes: 6 additions & 6 deletions bigquery/google/cloud/bigquery/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class _SyncQueryConfiguration(object):
class QueryResults(object):
"""Synchronous job: query tables.

:type query: string
:type query: str
:param query: SQL query string

:type client: :class:`google.cloud.bigquery.client.Client`
Expand Down Expand Up @@ -91,7 +91,7 @@ def from_query_job(cls, job):
def project(self):
"""Project bound to the job.

:rtype: string
:rtype: str
:returns: the project (derived from the client).
"""
return self._client.project
Expand All @@ -118,7 +118,7 @@ def cache_hit(self):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#cacheHit

:rtype: boolean or ``NoneType``
:rtype: bool or ``NoneType``
:returns: True if the query results were served from cache (None
until set by the server).
"""
Expand All @@ -131,7 +131,7 @@ def complete(self):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#jobComplete

:rtype: boolean or ``NoneType``
:rtype: bool or ``NoneType``
:returns: True if the query completed on the server (None
until set by the server).
"""
Expand Down Expand Up @@ -185,7 +185,7 @@ def page_token(self):
See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#pageToken

:rtype: string, or ``NoneType``
:rtype: str, or ``NoneType``
:returns: Token generated on the server (None until set by the server).
"""
return self._properties.get('pageToken')
Expand Down Expand Up @@ -348,7 +348,7 @@ def fetch_data(self, max_results=None, page_token=None, start_index=None,
:type max_results: integer or ``NoneType``
:param max_results: maximum number of rows to return.

:type page_token: string or ``NoneType``
:type page_token: str or ``NoneType``
:param page_token: token representing a cursor into the table's rows.

:type start_index: integer or ``NoneType``
Expand Down
Loading