From f5d74a03d5cc84befa3817f83ad2655af6fe5741 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 14 May 2020 00:36:14 -0700 Subject: [PATCH] fix: update backup timeouts (via synth) (#82) * [CHANGE ME] Re-generated to pick up changes in the API or client library generator. * remove _pb2 files and multiprocessing due to docs failures Co-authored-by: larkee --- .kokoro/publish-docs.sh | 2 - .../gapic/database_admin_client.py | 84 ++++++------- .../gapic/database_admin_client_config.py | 10 +- .../spanner_admin_database_v1/gapic/enums.py | 8 +- .../database_admin_grpc_transport.py | 22 ++-- .../spanner_admin_instance_v1/gapic/enums.py | 3 +- .../gapic/instance_admin_client.py | 38 +++--- .../instance_admin_grpc_transport.py | 2 +- google/cloud/spanner_v1/gapic/enums.py | 32 ++--- .../cloud/spanner_v1/gapic/spanner_client.py | 119 +++++++++--------- .../transports/spanner_grpc_transport.py | 40 +++--- synth.metadata | 24 ++-- 12 files changed, 189 insertions(+), 195 deletions(-) diff --git a/.kokoro/publish-docs.sh b/.kokoro/publish-docs.sh index bc384fe0ce..92506af8f8 100755 --- a/.kokoro/publish-docs.sh +++ b/.kokoro/publish-docs.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Disable buffering, so that the logs stream through. diff --git a/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py b/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py index f41559acc1..849f37160a 100644 --- a/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py +++ b/google/cloud/spanner_admin_database_v1/gapic/database_admin_client.py @@ -273,11 +273,11 @@ def create_database( Args: parent (str): Required. The name of the instance that will serve the new database. Values are of the form ``projects//instances/``. - create_statement (str): Required. A ``CREATE DATABASE`` statement, which specifies the ID of the - new database. The database ID must conform to the regular expression + create_statement (str): Required. A ``CREATE DATABASE`` statement, which specifies the ID of + the new database. The database ID must conform to the regular expression ``[a-z][a-z0-9_\-]*[a-z0-9]`` and be between 2 and 30 characters in length. If the database ID is a reserved word or if it contains a - hyphen, the database ID must be enclosed in backticks (`````). + hyphen, the database ID must be enclosed in backticks (:literal:`\``). extra_statements (list[str]): Optional. A list of DDL statements to run inside the newly created database. Statements can create tables, indexes, etc. These statements execute atomically with the creation of the database: @@ -451,9 +451,9 @@ def update_database_ddl( Args: database (str): Required. The database to update. statements (list[str]): Required. DDL statements to be applied to the database. - operation_id (str): If empty, the new update request is assigned an automatically-generated - operation ID. Otherwise, ``operation_id`` is used to construct the name - of the resulting ``Operation``. + operation_id (str): If empty, the new update request is assigned an + automatically-generated operation ID. Otherwise, ``operation_id`` is + used to construct the name of the resulting ``Operation``. Specifying an explicit operation ID simplifies determining whether the statements were executed in the event that the ``UpdateDatabaseDdl`` @@ -530,8 +530,8 @@ def drop_database( metadata=None, ): """ - Drops (aka deletes) a Cloud Spanner database. Completed backups for the - database will be retained according to their ``expire_time``. + Drops (aka deletes) a Cloud Spanner database. Completed backups for + the database will be retained according to their ``expire_time``. Example: >>> from google.cloud import spanner_admin_database_v1 @@ -597,9 +597,9 @@ def get_database_ddl( metadata=None, ): """ - Returns the schema of a Cloud Spanner database as a list of formatted - DDL statements. This method does not show pending schema updates, those - may be queried using the ``Operations`` API. + Returns the schema of a Cloud Spanner database as a list of + formatted DDL statements. This method does not show pending schema + updates, those may be queried using the ``Operations`` API. Example: >>> from google.cloud import spanner_admin_database_v1 @@ -845,10 +845,10 @@ def test_iam_permissions( backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result - in a NOT\_FOUND error if the user has ``spanner.databases.list`` + in a NOT_FOUND error if the user has ``spanner.databases.list`` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does - not exist will result in a NOT\_FOUND error if the user has + not exist will result in a NOT_FOUND error if the user has ``spanner.backups.list`` permission on the containing instance. Example: @@ -867,8 +867,8 @@ def test_iam_permissions( Args: resource (str): REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more + permissions (list[str]): The set of permissions to check for the ``resource``. Permissions + with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM Overview `__. retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -966,13 +966,13 @@ def create_backup( >>> metadata = response.metadata() Args: - parent (str): Required. The name of the instance in which the backup will be created. - This must be the same instance that contains the database the backup - will be created from. The backup will be stored in the location(s) - specified in the instance configuration of this instance. Values are of - the form ``projects//instances/``. - backup_id (str): Required. The id of the backup to be created. The ``backup_id`` appended - to ``parent`` forms the full backup name of the form + parent (str): Required. The name of the instance in which the backup will be + created. This must be the same instance that contains the database the + backup will be created from. The backup will be stored in the + location(s) specified in the instance configuration of this instance. + Values are of the form ``projects//instances/``. + backup_id (str): Required. The id of the backup to be created. The ``backup_id`` + appended to ``parent`` forms the full backup name of the form ``projects//instances//backups/``. backup (Union[dict, ~google.cloud.spanner_admin_database_v1.types.Backup]): Required. The backup to create. @@ -1129,18 +1129,18 @@ def update_backup( >>> response = client.update_backup(backup, update_mask) Args: - backup (Union[dict, ~google.cloud.spanner_admin_database_v1.types.Backup]): Required. The backup to update. ``backup.name``, and the fields to be - updated as specified by ``update_mask`` are required. Other fields are - ignored. Update is only supported for the following fields: + backup (Union[dict, ~google.cloud.spanner_admin_database_v1.types.Backup]): Required. The backup to update. ``backup.name``, and the fields to + be updated as specified by ``update_mask`` are required. Other fields + are ignored. Update is only supported for the following fields: - ``backup.expire_time``. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_admin_database_v1.types.Backup` - update_mask (Union[dict, ~google.cloud.spanner_admin_database_v1.types.FieldMask]): Required. A mask specifying which fields (e.g. ``expire_time``) in the - Backup resource should be updated. This mask is relative to the Backup - resource, not to the request message. The field mask must always be - specified; this prevents any future fields from being erased + update_mask (Union[dict, ~google.cloud.spanner_admin_database_v1.types.FieldMask]): Required. A mask specifying which fields (e.g. ``expire_time``) in + the Backup resource should be updated. This mask is relative to the + Backup resource, not to the request message. The field mask must always + be specified; this prevents any future fields from being erased accidentally by clients that do not know about them. If a dict is provided, it must be of the same form as the protobuf @@ -1450,9 +1450,9 @@ def restore_database( database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form ``projects//instances/``. - database_id (str): Required. The id of the database to create and restore to. This database - must not already exist. The ``database_id`` appended to ``parent`` forms - the full database name of the form + database_id (str): Required. The id of the database to create and restore to. This + database must not already exist. The ``database_id`` appended to + ``parent`` forms the full database name of the form ``projects//instances//databases/``. backup (str): Name of the backup from which to restore. Values are of the form ``projects//instances//backups/``. @@ -1526,8 +1526,8 @@ def list_database_operations( metadata=None, ): """ - Lists database ``longrunning-operations``. A database operation has a - name of the form + Lists database ``longrunning-operations``. A database operation has + a name of the form ``projects//instances//databases//operations/``. The long-running operation ``metadata`` field type ``metadata.type_url`` describes the type of the metadata. Operations returned include those @@ -1594,8 +1594,8 @@ def list_database_operations( - The operation's metadata type is ``RestoreDatabaseMetadata``. - The database is restored from a backup. - - The backup name contains "backup\_howl". - - The restored database's name contains "restored\_howl". + - The backup name contains "backup_howl". + - The restored database's name contains "restored_howl". - The operation started before 2018-03-28T14:50:00Z. - The operation resulted in an error. page_size (int): The maximum number of resources contained in the @@ -1677,8 +1677,8 @@ def list_backup_operations( metadata=None, ): """ - Lists the backup ``long-running operations`` in the given instance. A - backup operation has a name of the form + Lists the backup ``long-running operations`` in the given instance. + A backup operation has a name of the form ``projects//instances//backups//operations/``. The long-running operation ``metadata`` field type ``metadata.type_url`` describes the type of the metadata. Operations returned include those @@ -1709,8 +1709,8 @@ def list_backup_operations( ... pass Args: - parent (str): Required. The instance of the backup operations. Values are of the form - ``projects//instances/``. + parent (str): Required. The instance of the backup operations. Values are of the + form ``projects//instances/``. filter_ (str): An expression that filters the list of returned backup operations. A filter expression consists of a field name, a comparison operator, and @@ -1851,8 +1851,8 @@ def list_databases( ... pass Args: - parent (str): Required. The instance whose databases should be listed. Values are of - the form ``projects//instances/``. + parent (str): Required. The instance whose databases should be listed. Values are + of the form ``projects//instances/``. page_size (int): The maximum number of resources contained in the underlying API response. If page streaming is performed per- resource, this parameter does not affect the return value. If page diff --git a/google/cloud/spanner_admin_database_v1/gapic/database_admin_client_config.py b/google/cloud/spanner_admin_database_v1/gapic/database_admin_client_config.py index c82216409b..d5d61cbae7 100644 --- a/google/cloud/spanner_admin_database_v1/gapic/database_admin_client_config.py +++ b/google/cloud/spanner_admin_database_v1/gapic/database_admin_client_config.py @@ -63,12 +63,12 @@ "retry_params_name": "default", }, "GetBackup": { - "timeout_millis": 30000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "UpdateBackup": { - "timeout_millis": 30000, + "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, @@ -78,7 +78,7 @@ "retry_params_name": "default", }, "ListBackups": { - "timeout_millis": 30000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, @@ -88,12 +88,12 @@ "retry_params_name": "default", }, "ListDatabaseOperations": { - "timeout_millis": 30000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, "ListBackupOperations": { - "timeout_millis": 30000, + "timeout_millis": 600000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, diff --git a/google/cloud/spanner_admin_database_v1/gapic/enums.py b/google/cloud/spanner_admin_database_v1/gapic/enums.py index d972ddfc57..575cb3a8f7 100644 --- a/google/cloud/spanner_admin_database_v1/gapic/enums.py +++ b/google/cloud/spanner_admin_database_v1/gapic/enums.py @@ -39,8 +39,8 @@ class State(enum.IntEnum): Attributes: STATE_UNSPECIFIED (int): Not specified. - CREATING (int): The pending backup is still being created. Operations on the backup may - fail with ``FAILED_PRECONDITION`` in this state. + CREATING (int): The pending backup is still being created. Operations on the backup + may fail with ``FAILED_PRECONDITION`` in this state. READY (int): The backup is complete and ready for use. """ @@ -56,8 +56,8 @@ class State(enum.IntEnum): Attributes: STATE_UNSPECIFIED (int): Not specified. - CREATING (int): The database is still being created. Operations on the database may fail - with ``FAILED_PRECONDITION`` in this state. + CREATING (int): The database is still being created. Operations on the database may + fail with ``FAILED_PRECONDITION`` in this state. READY (int): The database is fully created and ready for use. READY_OPTIMIZING (int): The database is fully created and ready for use, but is still being optimized for performance and cannot handle full load. diff --git a/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py b/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py index 2fb41caab2..e6496e2879 100644 --- a/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py +++ b/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py @@ -173,8 +173,8 @@ def update_database_ddl(self): def drop_database(self): """Return the gRPC stub for :meth:`DatabaseAdminClient.drop_database`. - Drops (aka deletes) a Cloud Spanner database. Completed backups for the - database will be retained according to their ``expire_time``. + Drops (aka deletes) a Cloud Spanner database. Completed backups for + the database will be retained according to their ``expire_time``. Returns: Callable: A callable which accepts the appropriate @@ -187,9 +187,9 @@ def drop_database(self): def get_database_ddl(self): """Return the gRPC stub for :meth:`DatabaseAdminClient.get_database_ddl`. - Returns the schema of a Cloud Spanner database as a list of formatted - DDL statements. This method does not show pending schema updates, those - may be queried using the ``Operations`` API. + Returns the schema of a Cloud Spanner database as a list of + formatted DDL statements. This method does not show pending schema + updates, those may be queried using the ``Operations`` API. Returns: Callable: A callable which accepts the appropriate @@ -243,10 +243,10 @@ def test_iam_permissions(self): backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result - in a NOT\_FOUND error if the user has ``spanner.databases.list`` + in a NOT_FOUND error if the user has ``spanner.databases.list`` permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does - not exist will result in a NOT\_FOUND error if the user has + not exist will result in a NOT_FOUND error if the user has ``spanner.backups.list`` permission on the containing instance. Returns: @@ -360,8 +360,8 @@ def restore_database(self): def list_database_operations(self): """Return the gRPC stub for :meth:`DatabaseAdminClient.list_database_operations`. - Lists database ``longrunning-operations``. A database operation has a - name of the form + Lists database ``longrunning-operations``. A database operation has + a name of the form ``projects//instances//databases//operations/``. The long-running operation ``metadata`` field type ``metadata.type_url`` describes the type of the metadata. Operations returned include those @@ -379,8 +379,8 @@ def list_database_operations(self): def list_backup_operations(self): """Return the gRPC stub for :meth:`DatabaseAdminClient.list_backup_operations`. - Lists the backup ``long-running operations`` in the given instance. A - backup operation has a name of the form + Lists the backup ``long-running operations`` in the given instance. + A backup operation has a name of the form ``projects//instances//backups//operations/``. The long-running operation ``metadata`` field type ``metadata.type_url`` describes the type of the metadata. Operations returned include those diff --git a/google/cloud/spanner_admin_instance_v1/gapic/enums.py b/google/cloud/spanner_admin_instance_v1/gapic/enums.py index cfb40655be..e93cf829d0 100644 --- a/google/cloud/spanner_admin_instance_v1/gapic/enums.py +++ b/google/cloud/spanner_admin_instance_v1/gapic/enums.py @@ -54,7 +54,8 @@ class ReplicaType(enum.IntEnum): - Can vote whether to commit a write. - Participate in leadership election. - Are eligible to become a leader. - READ_ONLY (int): Read-only replicas only support reads (not writes). Read-only replicas: + READ_ONLY (int): Read-only replicas only support reads (not writes). Read-only + replicas: - Maintain a full copy of your data. - Serve reads. diff --git a/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py b/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py index 0dd85486b2..ae9e6a7e3e 100644 --- a/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py +++ b/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py @@ -274,8 +274,8 @@ def list_instance_configs( ... pass Args: - parent (str): Required. The name of the project for which a list of supported instance - configurations is requested. Values are of the form + parent (str): Required. The name of the project for which a list of supported + instance configurations is requested. Values are of the form ``projects/``. page_size (int): The maximum number of resources contained in the underlying API response. If page streaming is performed per- @@ -366,8 +366,8 @@ def get_instance_config( >>> response = client.get_instance_config(name) Args: - name (str): Required. The name of the requested instance configuration. Values are - of the form ``projects//instanceConfigs/``. + name (str): Required. The name of the requested instance configuration. Values + are of the form ``projects//instanceConfigs/``. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -457,8 +457,8 @@ def list_instances( resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. - filter_ (str): An expression for filtering the results of the request. Filter rules are - case insensitive. The fields eligible for filtering are: + filter_ (str): An expression for filtering the results of the request. Filter rules + are case insensitive. The fields eligible for filtering are: - ``name`` - ``display_name`` @@ -562,8 +562,8 @@ def get_instance( Args: name (str): Required. The name of the requested instance. Values are of the form ``projects//instances/``. - field_mask (Union[dict, ~google.cloud.spanner_admin_instance_v1.types.FieldMask]): If field\_mask is present, specifies the subset of ``Instance`` fields - that should be returned. If absent, all ``Instance`` fields are + field_mask (Union[dict, ~google.cloud.spanner_admin_instance_v1.types.FieldMask]): If field_mask is present, specifies the subset of ``Instance`` + fields that should be returned. If absent, all ``Instance`` fields are returned. If a dict is provided, it must be of the same form as the protobuf @@ -687,9 +687,9 @@ def create_instance( Args: parent (str): Required. The name of the project in which to create the instance. Values are of the form ``projects/``. - instance_id (str): Required. The ID of the instance to create. Valid identifiers are of the - form ``[a-z][-a-z0-9]*[a-z0-9]`` and must be between 2 and 64 characters - in length. + instance_id (str): Required. The ID of the instance to create. Valid identifiers are of + the form ``[a-z][-a-z0-9]*[a-z0-9]`` and must be between 2 and 64 + characters in length. instance (Union[dict, ~google.cloud.spanner_admin_instance_v1.types.Instance]): Required. The instance to create. The name may be omitted, but if specified must be ``/instances/``. @@ -820,9 +820,9 @@ def update_instance( >>> metadata = response.metadata() Args: - instance (Union[dict, ~google.cloud.spanner_admin_instance_v1.types.Instance]): Required. The instance to update, which must always include the instance - name. Otherwise, only fields mentioned in ``field_mask`` need be - included. + instance (Union[dict, ~google.cloud.spanner_admin_instance_v1.types.Instance]): Required. The instance to update, which must always include the + instance name. Otherwise, only fields mentioned in ``field_mask`` need + be included. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_admin_instance_v1.types.Instance` @@ -919,8 +919,8 @@ def delete_instance( >>> client.delete_instance(name) Args: - name (str): Required. The name of the instance to be deleted. Values are of the form - ``projects//instances/`` + name (str): Required. The name of the instance to be deleted. Values are of the + form ``projects//instances/`` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1148,7 +1148,7 @@ def test_iam_permissions( resource. Attempting this RPC on a non-existent Cloud Spanner instance resource - will result in a NOT\_FOUND error if the user has + will result in a NOT_FOUND error if the user has ``spanner.instances.list`` permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions. @@ -1168,8 +1168,8 @@ def test_iam_permissions( Args: resource (str): REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more + permissions (list[str]): The set of permissions to check for the ``resource``. Permissions + with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM Overview `__. retry (Optional[google.api_core.retry.Retry]): A retry object used diff --git a/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py b/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py index 1d3c404bf6..c0fd87efbe 100644 --- a/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py +++ b/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py @@ -328,7 +328,7 @@ def test_iam_permissions(self): resource. Attempting this RPC on a non-existent Cloud Spanner instance resource - will result in a NOT\_FOUND error if the user has + will result in a NOT_FOUND error if the user has ``spanner.instances.list`` permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions. diff --git a/google/cloud/spanner_v1/gapic/enums.py b/google/cloud/spanner_v1/gapic/enums.py index 445abc8429..1372d3c05a 100644 --- a/google/cloud/spanner_v1/gapic/enums.py +++ b/google/cloud/spanner_v1/gapic/enums.py @@ -21,8 +21,8 @@ class NullValue(enum.IntEnum): """ - ``NullValue`` is a singleton enumeration to represent the null value for - the ``Value`` type union. + ``NullValue`` is a singleton enumeration to represent the null value + for the ``Value`` type union. The JSON representation for ``NullValue`` is JSON ``null``. @@ -35,8 +35,8 @@ class NullValue(enum.IntEnum): class TypeCode(enum.IntEnum): """ - ``TypeCode`` is used as part of ``Type`` to indicate the type of a Cloud - Spanner value. + ``TypeCode`` is used as part of ``Type`` to indicate the type of a + Cloud Spanner value. Each legal value of a type can be encoded to or decoded from a JSON value, using the encodings described below. All Cloud Spanner values can @@ -49,8 +49,8 @@ class TypeCode(enum.IntEnum): INT64 (int): Encoded as ``string``, in decimal format. FLOAT64 (int): Encoded as ``number``, or the strings ``"NaN"``, ``"Infinity"``, or ``"-Infinity"``. - TIMESTAMP (int): Encoded as ``string`` in RFC 3339 timestamp format. The time zone must - be present, and must be ``"Z"``. + TIMESTAMP (int): Encoded as ``string`` in RFC 3339 timestamp format. The time zone + must be present, and must be ``"Z"``. If the schema has the column option ``allow_commit_timestamp=true``, the placeholder string ``"spanner.commit_timestamp()"`` can be used to @@ -60,10 +60,11 @@ class TypeCode(enum.IntEnum): STRING (int): Encoded as ``string``. BYTES (int): Encoded as a base64-encoded ``string``, as described in RFC 4648, section 4. - ARRAY (int): Encoded as ``list``, where the list elements are represented according - to ``array_element_type``. - STRUCT (int): Encoded as ``list``, where list element ``i`` is represented according - to [struct\_type.fields[i]][google.spanner.v1.StructType.fields]. + ARRAY (int): Encoded as ``list``, where the list elements are represented + according to ``array_element_type``. + STRUCT (int): Encoded as ``list``, where list element ``i`` is represented + according to + [struct_type.fields[i]][google.spanner.v1.StructType.fields]. """ TYPE_CODE_UNSPECIFIED = 0 @@ -99,14 +100,15 @@ class QueryMode(enum.IntEnum): class PlanNode(object): class Kind(enum.IntEnum): """ - The kind of ``PlanNode``. Distinguishes between the two different kinds - of nodes that can appear in a query plan. + The kind of ``PlanNode``. Distinguishes between the two different + kinds of nodes that can appear in a query plan. Attributes: KIND_UNSPECIFIED (int): Not specified. - RELATIONAL (int): Denotes a Relational operator node in the expression tree. Relational - operators represent iterative processing of rows during query execution. - For example, a ``TableScan`` operation that reads rows from a table. + RELATIONAL (int): Denotes a Relational operator node in the expression tree. + Relational operators represent iterative processing of rows during query + execution. For example, a ``TableScan`` operation that reads rows from a + table. SCALAR (int): Denotes a Scalar node in the expression tree. Scalar nodes represent non-iterable entities in the query plan. For example, constants or arithmetic operators appearing inside predicate expressions or references diff --git a/google/cloud/spanner_v1/gapic/spanner_client.py b/google/cloud/spanner_v1/gapic/spanner_client.py index 20b6522780..c0454761a0 100644 --- a/google/cloud/spanner_v1/gapic/spanner_client.py +++ b/google/cloud/spanner_v1/gapic/spanner_client.py @@ -336,8 +336,8 @@ def batch_create_sessions( Args: database (str): Required. The database in which the new sessions are created. - session_count (int): Required. The number of sessions to be created in this batch call. The - API may return fewer than the requested number of sessions. If a + session_count (int): Required. The number of sessions to be created in this batch call. + The API may return fewer than the requested number of sessions. If a specific number of sessions are desired, the client can make additional calls to BatchCreateSessions (adjusting ``session_count`` as necessary). session_template (Union[dict, ~google.cloud.spanner_v1.types.Session]): Parameters to be applied to each created session. @@ -506,8 +506,8 @@ def list_sessions( resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page. - filter_ (str): An expression for filtering the results of the request. Filter rules are - case insensitive. The fields eligible for filtering are: + filter_ (str): An expression for filtering the results of the request. Filter rules + are case insensitive. The fields eligible for filtering are: - ``labels.key`` where key is the name of a label @@ -665,9 +665,9 @@ def execute_sql( metadata=None, ): """ - Executes an SQL statement, returning all results in a single reply. This - method cannot be used to return a result set larger than 10 MiB; if the - query yields more data than that, the query fails with a + Executes an SQL statement, returning all results in a single reply. + This method cannot be used to return a result set larger than 10 MiB; if + the query yields more data than that, the query fails with a ``FAILED_PRECONDITION`` error. Operations inside read-write transactions might return ``ABORTED``. If @@ -705,7 +705,8 @@ def execute_sql( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_v1.types.TransactionSelector` - params (Union[dict, ~google.cloud.spanner_v1.types.Struct]): Parameter names and values that bind to placeholders in the SQL string. + params (Union[dict, ~google.cloud.spanner_v1.types.Struct]): Parameter names and values that bind to placeholders in the SQL + string. A parameter placeholder consists of the ``@`` character followed by the parameter name (for example, ``@firstName``). Parameter names can @@ -720,9 +721,9 @@ def execute_sql( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_v1.types.Struct` - param_types (dict[str -> Union[dict, ~google.cloud.spanner_v1.types.Type]]): It is not always possible for Cloud Spanner to infer the right SQL type - from a JSON value. For example, values of type ``BYTES`` and values of - type ``STRING`` both appear in ``params`` as JSON strings. + param_types (dict[str -> Union[dict, ~google.cloud.spanner_v1.types.Type]]): It is not always possible for Cloud Spanner to infer the right SQL + type from a JSON value. For example, values of type ``BYTES`` and values + of type ``STRING`` both appear in ``params`` as JSON strings. In these cases, ``param_types`` can be used to specify the exact SQL type for some or all of the SQL statement parameters. See the definition @@ -742,7 +743,7 @@ def execute_sql( partition_token (bytes): If present, results will be restricted to the specified partition previously created using PartitionQuery(). There must be an exact match for the values of fields common to this message and the - PartitionQueryRequest message used to create this partition\_token. + PartitionQueryRequest message used to create this partition_token. seqno (long): A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one will succeed. @@ -833,10 +834,10 @@ def execute_streaming_sql( metadata=None, ): """ - Like ``ExecuteSql``, except returns the result set as a stream. Unlike - ``ExecuteSql``, there is no limit on the size of the returned result - set. However, no individual row in the result set can exceed 100 MiB, - and no column value can exceed 10 MiB. + Like ``ExecuteSql``, except returns the result set as a stream. + Unlike ``ExecuteSql``, there is no limit on the size of the returned + result set. However, no individual row in the result set can exceed 100 + MiB, and no column value can exceed 10 MiB. Example: >>> from google.cloud import spanner_v1 @@ -868,7 +869,8 @@ def execute_streaming_sql( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_v1.types.TransactionSelector` - params (Union[dict, ~google.cloud.spanner_v1.types.Struct]): Parameter names and values that bind to placeholders in the SQL string. + params (Union[dict, ~google.cloud.spanner_v1.types.Struct]): Parameter names and values that bind to placeholders in the SQL + string. A parameter placeholder consists of the ``@`` character followed by the parameter name (for example, ``@firstName``). Parameter names can @@ -883,9 +885,9 @@ def execute_streaming_sql( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_v1.types.Struct` - param_types (dict[str -> Union[dict, ~google.cloud.spanner_v1.types.Type]]): It is not always possible for Cloud Spanner to infer the right SQL type - from a JSON value. For example, values of type ``BYTES`` and values of - type ``STRING`` both appear in ``params`` as JSON strings. + param_types (dict[str -> Union[dict, ~google.cloud.spanner_v1.types.Type]]): It is not always possible for Cloud Spanner to infer the right SQL + type from a JSON value. For example, values of type ``BYTES`` and values + of type ``STRING`` both appear in ``params`` as JSON strings. In these cases, ``param_types`` can be used to specify the exact SQL type for some or all of the SQL statement parameters. See the definition @@ -905,7 +907,7 @@ def execute_streaming_sql( partition_token (bytes): If present, results will be restricted to the specified partition previously created using PartitionQuery(). There must be an exact match for the values of fields common to this message and the - PartitionQueryRequest message used to create this partition\_token. + PartitionQueryRequest message used to create this partition_token. seqno (long): A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one will succeed. @@ -1030,11 +1032,11 @@ def execute_batch_dml( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_v1.types.TransactionSelector` - statements (list[Union[dict, ~google.cloud.spanner_v1.types.Statement]]): Required. The list of statements to execute in this batch. Statements - are executed serially, such that the effects of statement ``i`` are - visible to statement ``i+1``. Each statement must be a DML statement. - Execution stops at the first failed statement; the remaining statements - are not executed. + statements (list[Union[dict, ~google.cloud.spanner_v1.types.Statement]]): Required. The list of statements to execute in this batch. + Statements are executed serially, such that the effects of statement + ``i`` are visible to statement ``i+1``. Each statement must be a DML + statement. Execution stops at the first failed statement; the remaining + statements are not executed. Callers must provide at least one statement. @@ -1114,10 +1116,11 @@ def read( metadata=None, ): """ - Reads rows from the database using key lookups and scans, as a simple - key/value style alternative to ``ExecuteSql``. This method cannot be - used to return a result set larger than 10 MiB; if the read matches more - data than that, the read fails with a ``FAILED_PRECONDITION`` error. + Reads rows from the database using key lookups and scans, as a + simple key/value style alternative to ``ExecuteSql``. This method cannot + be used to return a result set larger than 10 MiB; if the read matches + more data than that, the read fails with a ``FAILED_PRECONDITION`` + error. Reads inside read-write transactions might return ``ABORTED``. If this occurs, the application should restart the transaction from the @@ -1147,8 +1150,8 @@ def read( Args: session (str): Required. The session in which the read should be performed. table (str): Required. The name of the table in the database to be read. - columns (list[str]): Required. The columns of ``table`` to be returned for each row matching - this request. + columns (list[str]): Required. The columns of ``table`` to be returned for each row + matching this request. key_set (Union[dict, ~google.cloud.spanner_v1.types.KeySet]): Required. ``key_set`` identifies the rows to be yielded. ``key_set`` names the primary keys of the rows in ``table`` to be yielded, unless ``index`` is present. If ``index`` is present, then ``key_set`` instead @@ -1183,7 +1186,7 @@ def read( partition_token (bytes): If present, results will be restricted to the specified partition previously created using PartitionRead(). There must be an exact match for the values of fields common to this message and the - PartitionReadRequest message used to create this partition\_token. + PartitionReadRequest message used to create this partition_token. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1284,8 +1287,8 @@ def streaming_read( Args: session (str): Required. The session in which the read should be performed. table (str): Required. The name of the table in the database to be read. - columns (list[str]): Required. The columns of ``table`` to be returned for each row matching - this request. + columns (list[str]): Required. The columns of ``table`` to be returned for each row + matching this request. key_set (Union[dict, ~google.cloud.spanner_v1.types.KeySet]): Required. ``key_set`` identifies the rows to be yielded. ``key_set`` names the primary keys of the rows in ``table`` to be yielded, unless ``index`` is present. If ``index`` is present, then ``key_set`` instead @@ -1320,7 +1323,7 @@ def streaming_read( partition_token (bytes): If present, results will be restricted to the specified partition previously created using PartitionRead(). There must be an exact match for the values of fields common to this message and the - PartitionReadRequest message used to create this partition\_token. + PartitionReadRequest message used to create this partition_token. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1469,8 +1472,8 @@ def commit( metadata=None, ): """ - Commits a transaction. The request includes the mutations to be applied - to rows in the database. + Commits a transaction. The request includes the mutations to be + applied to rows in the database. ``Commit`` might return an ``ABORTED`` error. This can occur at any time; commonly, the cause is conflicts with concurrent transactions. @@ -1490,12 +1493,12 @@ def commit( Args: session (str): Required. The session in which the transaction to be committed is running. transaction_id (bytes): Commit a previously-started transaction. - single_use_transaction (Union[dict, ~google.cloud.spanner_v1.types.TransactionOptions]): Execute mutations in a temporary transaction. Note that unlike commit of - a previously-started transaction, commit with a temporary transaction is - non-idempotent. That is, if the ``CommitRequest`` is sent to Cloud - Spanner more than once (for instance, due to retries in the application, - or in the transport library), it is possible that the mutations are - executed more than once. If this is undesirable, use + single_use_transaction (Union[dict, ~google.cloud.spanner_v1.types.TransactionOptions]): Execute mutations in a temporary transaction. Note that unlike + commit of a previously-started transaction, commit with a temporary + transaction is non-idempotent. That is, if the ``CommitRequest`` is sent + to Cloud Spanner more than once (for instance, due to retries in the + application, or in the transport library), it is possible that the + mutations are executed more than once. If this is undesirable, use ``BeginTransaction`` and ``Commit`` instead. If a dict is provided, it must be of the same form as the protobuf @@ -1657,11 +1660,11 @@ def partition_query( metadata=None, ): """ - Creates a set of partition tokens that can be used to execute a query - operation in parallel. Each of the returned partition tokens can be used - by ``ExecuteStreamingSql`` to specify a subset of the query result to - read. The same session and read-only transaction must be used by the - PartitionQueryRequest used to create the partition tokens and the + Creates a set of partition tokens that can be used to execute a + query operation in parallel. Each of the returned partition tokens can + be used by ``ExecuteStreamingSql`` to specify a subset of the query + result to read. The same session and read-only transaction must be used + by the PartitionQueryRequest used to create the partition tokens and the ExecuteSqlRequests that use the partition tokens. Partition tokens become invalid when the session used to create them is @@ -1683,9 +1686,9 @@ def partition_query( Args: session (str): Required. The session used to create the partitions. - sql (str): Required. The query request to generate partitions for. The request will - fail if the query is not root partitionable. The query plan of a root - partitionable query has a single distributed union operator. A + sql (str): Required. The query request to generate partitions for. The request + will fail if the query is not root partitionable. The query plan of a + root partitionable query has a single distributed union operator. A distributed union operator conceptually divides one or more tables into multiple splits, remotely evaluates a subquery independently on each split, and then unions all results. @@ -1698,7 +1701,8 @@ def partition_query( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_v1.types.TransactionSelector` - params (Union[dict, ~google.cloud.spanner_v1.types.Struct]): Parameter names and values that bind to placeholders in the SQL string. + params (Union[dict, ~google.cloud.spanner_v1.types.Struct]): Parameter names and values that bind to placeholders in the SQL + string. A parameter placeholder consists of the ``@`` character followed by the parameter name (for example, ``@firstName``). Parameter names can @@ -1713,9 +1717,9 @@ def partition_query( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.spanner_v1.types.Struct` - param_types (dict[str -> Union[dict, ~google.cloud.spanner_v1.types.Type]]): It is not always possible for Cloud Spanner to infer the right SQL type - from a JSON value. For example, values of type ``BYTES`` and values of - type ``STRING`` both appear in ``params`` as JSON strings. + param_types (dict[str -> Union[dict, ~google.cloud.spanner_v1.types.Type]]): It is not always possible for Cloud Spanner to infer the right SQL + type from a JSON value. For example, values of type ``BYTES`` and values + of type ``STRING`` both appear in ``params`` as JSON strings. In these cases, ``param_types`` can be used to specify the exact SQL type for some or all of the SQL query parameters. See the definition of @@ -1803,8 +1807,7 @@ def partition_read( PartitionReadRequest used to create the partition tokens and the ReadRequests that use the partition tokens. There are no ordering guarantees on rows returned among the returned partition tokens, or even - within each individual StreamingRead call issued with a - partition\_token. + within each individual StreamingRead call issued with a partition_token. Partition tokens become invalid when the session used to create them is deleted, is idle for too long, begins a new transaction, or becomes too diff --git a/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py b/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py index 72b7beeda6..7cb2cb2ef2 100644 --- a/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py +++ b/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py @@ -214,9 +214,9 @@ def delete_session(self): def execute_sql(self): """Return the gRPC stub for :meth:`SpannerClient.execute_sql`. - Executes an SQL statement, returning all results in a single reply. This - method cannot be used to return a result set larger than 10 MiB; if the - query yields more data than that, the query fails with a + Executes an SQL statement, returning all results in a single reply. + This method cannot be used to return a result set larger than 10 MiB; if + the query yields more data than that, the query fails with a ``FAILED_PRECONDITION`` error. Operations inside read-write transactions might return ``ABORTED``. If @@ -237,10 +237,10 @@ def execute_sql(self): def execute_streaming_sql(self): """Return the gRPC stub for :meth:`SpannerClient.execute_streaming_sql`. - Like ``ExecuteSql``, except returns the result set as a stream. Unlike - ``ExecuteSql``, there is no limit on the size of the returned result - set. However, no individual row in the result set can exceed 100 MiB, - and no column value can exceed 10 MiB. + Like ``ExecuteSql``, except returns the result set as a stream. + Unlike ``ExecuteSql``, there is no limit on the size of the returned + result set. However, no individual row in the result set can exceed 100 + MiB, and no column value can exceed 10 MiB. Returns: Callable: A callable which accepts the appropriate @@ -276,10 +276,11 @@ def execute_batch_dml(self): def read(self): """Return the gRPC stub for :meth:`SpannerClient.read`. - Reads rows from the database using key lookups and scans, as a simple - key/value style alternative to ``ExecuteSql``. This method cannot be - used to return a result set larger than 10 MiB; if the read matches more - data than that, the read fails with a ``FAILED_PRECONDITION`` error. + Reads rows from the database using key lookups and scans, as a + simple key/value style alternative to ``ExecuteSql``. This method cannot + be used to return a result set larger than 10 MiB; if the read matches + more data than that, the read fails with a ``FAILED_PRECONDITION`` + error. Reads inside read-write transactions might return ``ABORTED``. If this occurs, the application should restart the transaction from the @@ -330,8 +331,8 @@ def begin_transaction(self): def commit(self): """Return the gRPC stub for :meth:`SpannerClient.commit`. - Commits a transaction. The request includes the mutations to be applied - to rows in the database. + Commits a transaction. The request includes the mutations to be + applied to rows in the database. ``Commit`` might return an ``ABORTED`` error. This can occur at any time; commonly, the cause is conflicts with concurrent transactions. @@ -369,11 +370,11 @@ def rollback(self): def partition_query(self): """Return the gRPC stub for :meth:`SpannerClient.partition_query`. - Creates a set of partition tokens that can be used to execute a query - operation in parallel. Each of the returned partition tokens can be used - by ``ExecuteStreamingSql`` to specify a subset of the query result to - read. The same session and read-only transaction must be used by the - PartitionQueryRequest used to create the partition tokens and the + Creates a set of partition tokens that can be used to execute a + query operation in parallel. Each of the returned partition tokens can + be used by ``ExecuteStreamingSql`` to specify a subset of the query + result to read. The same session and read-only transaction must be used + by the PartitionQueryRequest used to create the partition tokens and the ExecuteSqlRequests that use the partition tokens. Partition tokens become invalid when the session used to create them is @@ -399,8 +400,7 @@ def partition_read(self): PartitionReadRequest used to create the partition tokens and the ReadRequests that use the partition tokens. There are no ordering guarantees on rows returned among the returned partition tokens, or even - within each individual StreamingRead call issued with a - partition\_token. + within each individual StreamingRead call issued with a partition_token. Partition tokens become invalid when the session used to create them is deleted, is idle for too long, begins a new transaction, or becomes too diff --git a/synth.metadata b/synth.metadata index 65874481f1..a157d58dab 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,32 +1,25 @@ { "sources": [ - { - "generator": { - "name": "artman", - "version": "2.0.0", - "dockerImage": "googleapis/artman@sha256:b3b47805231a305d0f40c4bf069df20f6a2635574e6d4259fac651d3f9f6e098" - } - }, { "git": { "name": ".", "remote": "https://github.com/googleapis/python-spanner.git", - "sha": "1d4976634cb81dd11b0ddc4bfc9fe9c61a7e7041" + "sha": "b8c1a671fab4f08e6ba77628bdd3fa7b84c91e54" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "sha": "89e89786896d256c70f43e68a975470c4f4f220e", + "internalRef": "311239362" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "f5e4c17dc78a966dbf29961dd01f9bbd63e20a04" + "sha": "84c4156c49be9dcabacc8fd7b0585b6fd789ae47" } } ], @@ -37,8 +30,7 @@ "apiName": "spanner", "apiVersion": "v1", "language": "python", - "generator": "gapic", - "config": "google/spanner/artman_spanner.yaml" + "generator": "bazel" } }, { @@ -47,8 +39,7 @@ "apiName": "spanner_admin_instance", "apiVersion": "v1", "language": "python", - "generator": "gapic", - "config": "google/spanner/admin/instance/artman_spanner_admin_instance.yaml" + "generator": "bazel" } }, { @@ -57,8 +48,7 @@ "apiName": "spanner_admin_database", "apiVersion": "v1", "language": "python", - "generator": "gapic", - "config": "google/spanner/admin/database/artman_spanner_admin_database.yaml" + "generator": "bazel" } } ]