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

Fix Numerous Spelling, Style, English Issues #2139

Merged
merged 1 commit into from
Aug 22, 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 gcloud/bigquery/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

"""Shared elper functions for BigQuery API classes."""
"""Shared helper functions for BigQuery API classes."""

from gcloud._helpers import _datetime_from_microseconds

Expand Down Expand Up @@ -149,13 +149,13 @@ def _validate(self, value):


class _EnumProperty(_ConfigurationProperty):
"""Psedo-enumeration class.
"""Pseudo-enumeration class.

Subclasses must define ``ALLOWED`` as a class-level constant: it must
be a sequence of strings.

:type name: string
:param name: name of the property
:param name: name of the property.
"""
def _validate(self, value):
"""Check that ``value`` is one of the allowed values.
Expand Down
16 changes: 8 additions & 8 deletions gcloud/bigquery/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,10 @@ def _parse_access_grants(access):
type is ``view``.

:type access: list of mappings
:param access: each mapping represents a single access grant
:param access: each mapping represents a single access grant.

:rtype: list of :class:`AccessGrant`
:returns: a list of parsed grants
:returns: a list of parsed grants.
:raises: :class:`ValueError` if a grant in ``access`` has more keys
than ``role`` and one additional key.
"""
Expand All @@ -358,7 +358,7 @@ def _set_properties(self, api_response):
"""Update properties from resource in body of ``api_response``

:type api_response: httplib2.Response
:param api_response: response returned from an API call
:param api_response: response returned from an API call.
"""
self._properties.clear()
cleaned = api_response.copy()
Expand Down Expand Up @@ -408,7 +408,7 @@ def _build_resource(self):
return resource

def create(self, client=None):
"""API call: create the dataset via a PUT request
"""API call: create the dataset via a PUT request.

See:
https://cloud.google.com/bigquery/docs/reference/v2/tables/insert
Expand Down Expand Up @@ -447,7 +447,7 @@ def exists(self, client=None):
return True

def reload(self, client=None):
"""API call: refresh dataset properties via a GET request
"""API call: refresh dataset properties via a GET request.

See
https://cloud.google.com/bigquery/docs/reference/v2/datasets/get
Expand All @@ -463,7 +463,7 @@ def reload(self, client=None):
self._set_properties(api_response)

def patch(self, client=None, **kw):
"""API call: update individual dataset properties via a PATCH request
"""API call: update individual dataset properties via a PATCH request.

See
https://cloud.google.com/bigquery/docs/reference/v2/datasets/patch
Expand Down Expand Up @@ -501,7 +501,7 @@ def patch(self, client=None, **kw):
self._set_properties(api_response)

def update(self, client=None):
"""API call: update dataset properties via a PUT request
"""API call: update dataset properties via a PUT request.

See
https://cloud.google.com/bigquery/docs/reference/v2/datasets/update
Expand All @@ -516,7 +516,7 @@ def update(self, client=None):
self._set_properties(api_response)

def delete(self, client=None):
"""API call: delete the dataset via a DELETE request
"""API call: delete the dataset via a DELETE request.

See:
https://cloud.google.com/bigquery/docs/reference/v2/tables/delete
Expand Down
8 changes: 4 additions & 4 deletions gcloud/bigquery/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class UDFResource(object):
:param udf_type: the type of the resource ('inlineCode' or 'resourceUri')

:type value: str
:param value: the inline code or resource URI
:param value: the inline code or resource URI.

See
https://cloud.google.com/bigquery/user-defined-functions#api
Expand All @@ -51,7 +51,7 @@ def __eq__(self, other):
def _build_udf_resources(resources):
"""
:type resources: sequence of :class:`UDFResource`
:param resources: fields to be appended
:param resources: fields to be appended.

:rtype: mapping
:returns: a mapping describing userDefinedFunctionResources for the query.
Expand All @@ -69,13 +69,13 @@ class UDFResourcesProperty(object):
Also used by :class:`~gcloud.bigquery.query.Query`.
"""
def __get__(self, instance, owner):
"""Descriptor protocal: accesstor"""
"""Descriptor protocol: accessor"""
if instance is None:
return self
return list(instance._udf_resources)

def __set__(self, instance, value):
"""Descriptor protocal: mutator"""
"""Descriptor protocol: mutator"""
if not all(isinstance(u, UDFResource) for u in value):
raise ValueError("udf items must be UDFResource")
instance._udf_resources = tuple(value)
Expand Down
4 changes: 2 additions & 2 deletions gcloud/bigquery/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def page_token(self):

@property
def total_rows(self):
"""Total number of rows returned by the query
"""Total number of rows returned by the query.

See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#totalRows
Expand All @@ -181,7 +181,7 @@ def total_rows(self):

@property
def total_bytes_processed(self):
"""Total number of bytes processed by the query
"""Total number of bytes processed by the query.

See:
https://cloud.google.com/bigquery/docs/reference/v2/jobs/query#totalBytesProcessed
Expand Down
8 changes: 4 additions & 4 deletions gcloud/bigquery/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ class SchemaField(object):
"""Describe a single field within a table schema.

:type name: str
:param name: the name of the field
:param name: the name of the field.

:type field_type: str
:param field_type: the type of the field (one of 'STRING', 'INTEGER',
'FLOAT', 'BOOLEAN', 'TIMESTAMP' or 'RECORD')
'FLOAT', 'BOOLEAN', 'TIMESTAMP' or 'RECORD').

:type mode: str
:param mode: the type of the field (one of 'NULLABLE', 'REQUIRED',
or 'REPEATED')
or 'REPEATED').

:type description: str
:param description: optional description for the field
:param description: optional description for the field.

:type fields: list of :class:`SchemaField`, or None
:param fields: subfields (requires ``field_type`` of 'RECORD').
Expand Down
22 changes: 11 additions & 11 deletions gcloud/bigquery/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,51 +813,51 @@ def upload_from_file(self,

:type allow_jagged_rows: boolean
:param allow_jagged_rows: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type allow_quoted_newlines: boolean
:param allow_quoted_newlines: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type create_disposition: str
:param create_disposition: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type encoding: str
:param encoding: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type field_delimiter: str
:param field_delimiter: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type ignore_unknown_values: boolean
:param ignore_unknown_values: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type max_bad_records: integer
:param max_bad_records: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type quote_character: str
:param quote_character: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type skip_leading_rows: integer
:param skip_leading_rows: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type write_disposition: str
:param write_disposition: job configuration option; see
:meth:`gcloud.bigquery.job.LoadJob`
:meth:`gcloud.bigquery.job.LoadJob`.

:type client: :class:`gcloud.storage.client.Client` or ``NoneType``
:param client: Optional. The client to use. If not passed, falls back
to the ``client`` stored on the current dataset.

:rtype: :class:`gcloud.bigquery.jobs.LoadTableFromStorageJob`
:returns: the job instance used to load the data (e.g., for
querying status)
querying status).
:raises: :class:`ValueError` if ``size`` is not passed in and can not
be determined, or if the ``file_obj`` can be detected to be
a file opened in text mode.
Expand Down
2 changes: 1 addition & 1 deletion gcloud/datastore/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class Batch(object):
"""An abstraction representing a collected group of updates / deletes.

Used to build up a bulk mutuation.
Used to build up a bulk mutation.

For example, the following snippet of code will put the two ``save``
operations and the ``delete`` operation into the same mutation, and send
Expand Down
2 changes: 1 addition & 1 deletion gcloud/datastore/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def delete_multi(self, keys):
"""Delete keys from the Cloud Datastore.

:type keys: list of :class:`gcloud.datastore.key.Key`
:param keys: The keys to be deleted from the datastore.
:param keys: The keys to be deleted from the Datastore.
"""
if not keys:
return
Expand Down
5 changes: 3 additions & 2 deletions gcloud/datastore/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ class Connection(connection_module.Connection):
"""A connection to the Google Cloud Datastore via the Protobuf API.

This class should understand only the basic types (and protobufs)
in method arguments, however should be capable of returning advanced types.
in method arguments, however it should be capable of returning advanced
types.

:type credentials: :class:`oauth2client.client.OAuth2Credentials`
:param credentials: The OAuth2 Credentials to use for this connection.
Expand Down Expand Up @@ -559,7 +560,7 @@ def begin_transaction(self, project):
return response.transaction

def commit(self, project, request, transaction_id):
"""Commit mutations in context of current transation (if any).
"""Commit mutations in context of current transaction (if any).

Maps the ``DatastoreService.Commit`` protobuf RPC.

Expand Down
4 changes: 2 additions & 2 deletions gcloud/datastore/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__(self, key=None, exclude_from_indexes=()):
def __eq__(self, other):
"""Compare two entities for equality.

Entities compare equal if their keys compare equal, and their
Entities compare equal if their keys compare equal and their
properties compare equal.

:rtype: boolean
Expand All @@ -105,7 +105,7 @@ def __eq__(self, other):
def __ne__(self, other):
"""Compare two entities for inequality.

Entities compare equal if their keys compare equal, and their
Entities compare equal if their keys compare equal and their
properties compare equal.

:rtype: boolean
Expand Down
2 changes: 1 addition & 1 deletion gcloud/datastore/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def _get_meaning(value_pb, is_list=False):
else: # We know len(value_pb.array_value.values) > 0.
# If the meaning is not unique, just return all of them.
meaning = all_meanings
elif value_pb.meaning: # Simple field (int32)
elif value_pb.meaning: # Simple field (int32).
meaning = value_pb.meaning

return meaning
Expand Down
1 change: 0 additions & 1 deletion gcloud/datastore/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ def completed_key(self, id_or_name):
if not self.is_partial:
raise ValueError('Only a partial key can be completed.')

id_or_name_key = None
if isinstance(id_or_name, six.string_types):
id_or_name_key = 'name'
elif isinstance(id_or_name, six.integer_types):
Expand Down
2 changes: 1 addition & 1 deletion gcloud/datastore/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Query(object):
stored in the Cloud Datastore.

:type client: :class:`gcloud.datastore.client.Client`
:param client: The client used to connect to datastore.
:param client: The client used to connect to Datastore.

:type kind: string
:param kind: The kind to query.
Expand Down
18 changes: 9 additions & 9 deletions gcloud/dns/changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def from_api_repr(cls, resource, zone):
"""Factory: construct a change set given its API representation

:type resource: dict
:param resource: change set representation returned from the API
:param resource: change set representation returned from the API.

:type zone: :class:`gcloud.dns.zone.ManagedZone`
:param zone: A zone which holds zero or more change sets.
Expand All @@ -59,7 +59,7 @@ def _set_properties(self, resource):
"""Helper method for :meth:`from_api_repr`, :meth:`create`, etc.

:type resource: dict
:param resource: change set representation returned from the API
:param resource: change set representation returned from the API.
"""
resource = resource.copy()
self._additions = tuple([
Expand Down Expand Up @@ -126,7 +126,7 @@ def additions(self):

:rtype: sequence of
:class:`gcloud.dns.resource_record_set.ResourceRecordSet`.
:returns: record sets appended via :meth:`add_record_set`
:returns: record sets appended via :meth:`add_record_set`.
"""
return self._additions

Expand All @@ -136,7 +136,7 @@ def deletions(self):

:rtype: sequence of
:class:`gcloud.dns.resource_record_set.ResourceRecordSet`.
:returns: record sets appended via :meth:`delete_record_set`
:returns: record sets appended via :meth:`delete_record_set`.
"""
return self._deletions

Expand All @@ -145,7 +145,7 @@ def add_record_set(self, record_set):

:type record_set:
:class:`gcloud.dns.resource_record_set.ResourceRecordSet`
:param record_set: the record set to append
:param record_set: the record set to append.

:raises: ``ValueError`` if ``record_set`` is not of the required type.
"""
Expand All @@ -158,7 +158,7 @@ def delete_record_set(self, record_set):

:type record_set:
:class:`gcloud.dns.resource_record_set.ResourceRecordSet`
:param record_set: the record set to append
:param record_set: the record set to append.

:raises: ``ValueError`` if ``record_set`` is not of the required type.
"""
Expand Down Expand Up @@ -202,7 +202,7 @@ def _build_resource(self):
}

def create(self, client=None):
"""API call: create the change set via a POST request
"""API call: create the change set via a POST request.

See:
https://cloud.google.com/dns/api/v1/changes/create
Expand All @@ -221,7 +221,7 @@ def create(self, client=None):
self._set_properties(api_response)

def exists(self, client=None):
"""API call: test for the existence of the change set via a GET request
"""API call: test for the existence of the change set via a GET request.

See
https://cloud.google.com/dns/api/v1/changes/get
Expand All @@ -243,7 +243,7 @@ def exists(self, client=None):
return True

def reload(self, client=None):
"""API call: refresh zone properties via a GET request
"""API call: refresh zone properties via a GET request.

See
https://cloud.google.com/dns/api/v1/changes/get
Expand Down
Loading