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 2 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
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
8 changes: 4 additions & 4 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 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
2 changes: 1 addition & 1 deletion bigtable/google/cloud/bigtable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def instance(self, instance_id, location=_EXISTING_INSTANCE_LOCATION_ID,
:type instance_id: str
:param instance_id: The ID of the instance.

:type location: string
:type location: str
:param location: location name, in form
``projects/<project>/locations/<location>``; used to
set up the instance's cluster.
Expand Down
2 changes: 1 addition & 1 deletion core/google/cloud/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def _pb_timestamp_to_rfc3339(timestamp_pb):
:type timestamp_pb: :class:`google.protobuf.timestamp_pb2.Timestamp`
:param timestamp_pb: A Google returned timestamp protobuf.

:rtype: string
:rtype: str
:returns: An RFC 3339 formatted timestamp string.
"""
timestamp = _pb_timestamp_to_datetime(timestamp_pb)
Expand Down
10 changes: 5 additions & 5 deletions core/google/cloud/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class _ClientFactoryMixin(object):
def from_service_account_json(cls, json_credentials_path, *args, **kwargs):
"""Factory to retrieve JSON credentials while creating client.

:type json_credentials_path: string
:type json_credentials_path: str
:param json_credentials_path: The path to a private key file (this file
was given to you when you created the
service account). This file must contain
Expand Down Expand Up @@ -69,10 +69,10 @@ def from_service_account_p12(cls, client_email, private_key_path,
Unless you have an explicit reason to use a PKCS12 key for your
service account, we recommend using a JSON key.

:type client_email: string
:type client_email: str
:param client_email: The e-mail attached to the service account.

:type private_key_path: string
:type private_key_path: str
:param private_key_path: The path to a private key file (this file was
given to you when you created the service
account). This file must be in P12 format.
Expand Down Expand Up @@ -127,7 +127,7 @@ def __init__(self, credentials=None, http=None):
class _ClientProjectMixin(object):
"""Mixin to allow setting the project on the client.

:type project: string
:type project: str
:param project: the project which the client acts on behalf of. If not
passed falls back to the default inferred from the
environment.
Expand Down Expand Up @@ -160,7 +160,7 @@ class JSONClient(Client, _ClientProjectMixin):
Assumes such APIs use the ``project`` and the client needs to store this
value.

:type project: string
:type project: str
:param project: the project which the client acts on behalf of. If not
passed falls back to the default inferred from the
environment.
Expand Down
Loading