From 6ef588b1de8395e25d29f97b2dd3a737b8dd7af8 Mon Sep 17 00:00:00 2001 From: larkee Date: Wed, 10 Mar 2021 23:42:59 +1100 Subject: [PATCH] docs: fix typos --- google/cloud/spanner_v1/batch.py | 2 +- google/cloud/spanner_v1/database.py | 12 ++++++------ google/cloud/spanner_v1/instance.py | 4 ++-- google/cloud/spanner_v1/keyset.py | 4 ++-- google/cloud/spanner_v1/pool.py | 4 ++-- google/cloud/spanner_v1/session.py | 2 +- google/cloud/spanner_v1/snapshot.py | 8 ++++---- google/cloud/spanner_v1/transaction.py | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/google/cloud/spanner_v1/batch.py b/google/cloud/spanner_v1/batch.py index 6a0158757d..9a79507886 100644 --- a/google/cloud/spanner_v1/batch.py +++ b/google/cloud/spanner_v1/batch.py @@ -179,7 +179,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): def _make_write_pb(table, columns, values): - """Helper for :meth:`Batch.insert` et aliae. + """Helper for :meth:`Batch.insert` et al. :type table: str :param table: Name of the table to be modified. diff --git a/google/cloud/spanner_v1/database.py b/google/cloud/spanner_v1/database.py index e5ea6b5bc0..dc7a9c072c 100644 --- a/google/cloud/spanner_v1/database.py +++ b/google/cloud/spanner_v1/database.py @@ -310,7 +310,7 @@ def __ne__(self, other): def create(self): """Create this database within its instance - Inclues any configured schema assigned to :attr:`ddl_statements`. + Includes any configured schema assigned to :attr:`ddl_statements`. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.database.v1#google.spanner.admin.database.v1.DatabaseAdmin.CreateDatabase @@ -568,7 +568,7 @@ def run_in_transaction(self, func, *args, **kw): :returns: The return value of ``func``. :raises Exception: - reraises any non-ABORT execptions raised by ``func``. + reraises any non-ABORT exceptions raised by ``func``. """ # Sanity check: Is there a transaction already running? # If there is, then raise a red flag. Otherwise, mark that this one @@ -895,7 +895,7 @@ def generate_read_batches( :rtype: iterable of dict :returns: - mappings of information used peform actual partitioned reads via + mappings of information used perform actual partitioned reads via :meth:`process_read_batch`. """ partitions = self._get_snapshot().partition_read( @@ -945,7 +945,7 @@ def generate_query_batches( Uses the ``PartitionQuery`` API request to start a partitioned query operation. Returns a list of batch information needed to - peform the actual queries. + perform the actual queries. :type sql: str :param sql: SQL query statement @@ -985,7 +985,7 @@ def generate_query_batches( :rtype: iterable of dict :returns: - mappings of information used peform actual partitioned reads via + mappings of information used perform actual partitioned reads via :meth:`process_read_batch`. """ partitions = self._get_snapshot().partition_query( @@ -1065,7 +1065,7 @@ def _check_ddl_statements(value): https://cloud.google.com/spanner/docs/data-definition-language :type value: list of string - :param value: DDL statements, excluding the 'CREATE DATABSE' statement + :param value: DDL statements, excluding the 'CREATE DATABASE' statement :rtype: tuple :returns: tuple of validated DDL statement strings. diff --git a/google/cloud/spanner_v1/instance.py b/google/cloud/spanner_v1/instance.py index aa8a9abedb..c4e7fcfe07 100644 --- a/google/cloud/spanner_v1/instance.py +++ b/google/cloud/spanner_v1/instance.py @@ -349,7 +349,7 @@ def delete(self): Soon afterward: - * The instance and all databases within the instance will be deleteed. + * The instance and all databases within the instance will be deleted. All data in the databases will be permanently deleted. """ api = self._client.instance_admin_api @@ -365,7 +365,7 @@ def database(self, database_id, ddl_statements=(), pool=None, logger=None): :type ddl_statements: list of string :param ddl_statements: (Optional) DDL statements, excluding the - 'CREATE DATABSE' statement. + 'CREATE DATABASE' statement. :type pool: concrete subclass of :class:`~google.cloud.spanner_v1.pool.AbstractSessionPool`. diff --git a/google/cloud/spanner_v1/keyset.py b/google/cloud/spanner_v1/keyset.py index 3c5f77a98f..ab712219f0 100644 --- a/google/cloud/spanner_v1/keyset.py +++ b/google/cloud/spanner_v1/keyset.py @@ -88,7 +88,7 @@ def _to_pb(self): return KeyRangePB(**kwargs) def _to_dict(self): - """Return keyrange's state as a dict. + """Return the state of the keyrange as a dict. :rtype: dict :returns: state of this instance. @@ -155,7 +155,7 @@ def _to_pb(self): return KeySetPB(**kwargs) def _to_dict(self): - """Return keyset's state as a dict. + """Return the state of the keyset as a dict. The result can be used to serialize the instance and reconstitute it later using :meth:`_from_dict`. diff --git a/google/cloud/spanner_v1/pool.py b/google/cloud/spanner_v1/pool.py index 112c277c86..b8b5ba1c14 100644 --- a/google/cloud/spanner_v1/pool.py +++ b/google/cloud/spanner_v1/pool.py @@ -42,7 +42,7 @@ def __init__(self, labels=None): @property def labels(self): - """User-assigned labels for sesions created by the pool. + """User-assigned labels for sessions created by the pool. :rtype: dict (str -> str) :returns: labels assigned by the user @@ -162,7 +162,7 @@ def bind(self, database): """Associate the pool with a database. :type database: :class:`~google.cloud.spanner_v1.database.Database` - :param database: database used by the pool: used to create sessions + :param database: database used by the pool to used to create sessions when needed. """ self._database = database diff --git a/google/cloud/spanner_v1/session.py b/google/cloud/spanner_v1/session.py index 03ab915602..853c5c5c18 100644 --- a/google/cloud/spanner_v1/session.py +++ b/google/cloud/spanner_v1/session.py @@ -321,7 +321,7 @@ def run_in_transaction(self, func, *args, **kw): :returns: The return value of ``func``. :raises Exception: - reraises any non-ABORT execptions raised by ``func``. + reraises any non-ABORT exceptions raised by ``func``. """ deadline = time.time() + kw.pop("timeout_secs", DEFAULT_RETRY_TIMEOUT_SECS) attempts = 0 diff --git a/google/cloud/spanner_v1/snapshot.py b/google/cloud/spanner_v1/snapshot.py index 7067c97bf8..37638df6fa 100644 --- a/google/cloud/spanner_v1/snapshot.py +++ b/google/cloud/spanner_v1/snapshot.py @@ -297,7 +297,7 @@ def partition_read( partition_size_bytes=None, max_partitions=None, ): - """Perform a ``ParitionRead`` API request for rows in a table. + """Perform a ``PartitionRead`` API request for rows in a table. :type table: str :param table: name of the table from which to fetch data @@ -328,7 +328,7 @@ def partition_read( :raises ValueError: for single-use snapshots, or if a transaction ID is - already associtated with the snapshot. + already associated with the snapshot. """ if not self._multi_use: raise ValueError("Cannot use single-use snapshot.") @@ -369,7 +369,7 @@ def partition_query( partition_size_bytes=None, max_partitions=None, ): - """Perform a ``ParitionQuery`` API request. + """Perform a ``PartitionQuery`` API request. :type sql: str :param sql: SQL query statement @@ -399,7 +399,7 @@ def partition_query( :raises ValueError: for single-use snapshots, or if a transaction ID is - already associtated with the snapshot. + already associated with the snapshot. """ if not self._multi_use: raise ValueError("Cannot use single-use snapshot.") diff --git a/google/cloud/spanner_v1/transaction.py b/google/cloud/spanner_v1/transaction.py index 87f3f1e3a9..39e264e70c 100644 --- a/google/cloud/spanner_v1/transaction.py +++ b/google/cloud/spanner_v1/transaction.py @@ -266,7 +266,7 @@ def batch_update(self, statements): Tuple(status, Sequence[int]) :returns: Status code, plus counts of rows affected by each completed DML - statement. Note that if the staus code is not ``OK``, the + statement. Note that if the status code is not ``OK``, the statement triggering the error will not have an entry in the list, nor will any statements following that one. """