From fc9379232224f56d29d2e36559a756c05a5478ff Mon Sep 17 00:00:00 2001 From: rahul2393 Date: Tue, 26 Aug 2025 14:12:20 +0530 Subject: [PATCH 1/6] deps: Remove Python 3.7 and 3.8 as supported runtimes (#1395) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * deps: Remove Python 3.7 and 3.8 as supported runtimes * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix build * update required check --------- Co-authored-by: Owl Bot --- .github/sync-repo-settings.yaml | 2 +- .github/workflows/presubmit.yaml | 4 +-- .kokoro/samples/python3.7/common.cfg | 40 --------------------- .kokoro/samples/python3.7/continuous.cfg | 6 ---- .kokoro/samples/python3.7/periodic-head.cfg | 11 ------ .kokoro/samples/python3.7/periodic.cfg | 6 ---- .kokoro/samples/python3.7/presubmit.cfg | 6 ---- .kokoro/samples/python3.8/common.cfg | 40 --------------------- .kokoro/samples/python3.8/continuous.cfg | 6 ---- .kokoro/samples/python3.8/periodic-head.cfg | 11 ------ .kokoro/samples/python3.8/periodic.cfg | 6 ---- .kokoro/samples/python3.8/presubmit.cfg | 6 ---- CONTRIBUTING.rst | 16 ++++----- README.rst | 5 +-- noxfile.py | 9 ++--- owlbot.py | 13 +++++++ samples/samples/noxfile.py | 4 +-- samples/samples/snippets.py | 4 +-- samples/samples/snippets_test.py | 13 +++++-- setup.py | 4 +-- testing/constraints-3.7.txt | 20 ----------- testing/constraints-3.8.txt | 7 ---- 22 files changed, 43 insertions(+), 196 deletions(-) delete mode 100644 .kokoro/samples/python3.7/common.cfg delete mode 100644 .kokoro/samples/python3.7/continuous.cfg delete mode 100644 .kokoro/samples/python3.7/periodic-head.cfg delete mode 100644 .kokoro/samples/python3.7/periodic.cfg delete mode 100644 .kokoro/samples/python3.7/presubmit.cfg delete mode 100644 .kokoro/samples/python3.8/common.cfg delete mode 100644 .kokoro/samples/python3.8/continuous.cfg delete mode 100644 .kokoro/samples/python3.8/periodic-head.cfg delete mode 100644 .kokoro/samples/python3.8/periodic.cfg delete mode 100644 .kokoro/samples/python3.8/presubmit.cfg delete mode 100644 testing/constraints-3.7.txt delete mode 100644 testing/constraints-3.8.txt diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 5b2a506d17..d726d1193d 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -11,5 +11,5 @@ branchProtectionRules: - 'Kokoro system-3.12' - 'cla/google' - 'Samples - Lint' - - 'Samples - Python 3.8' + - 'Samples - Python 3.9' - 'Samples - Python 3.12' diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 2d6132bd97..ab674fd370 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -17,7 +17,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.8 + python-version: 3.9 - name: Install nox run: python -m pip install nox - name: Check formatting @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - name: Checkout code diff --git a/.kokoro/samples/python3.7/common.cfg b/.kokoro/samples/python3.7/common.cfg deleted file mode 100644 index 29ad87b5fc..0000000000 --- a/.kokoro/samples/python3.7/common.cfg +++ /dev/null @@ -1,40 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Specify which tests to run -env_vars: { - key: "RUN_TESTS_SESSION" - value: "py-3.7" -} - -# Declare build specific Cloud project. -env_vars: { - key: "BUILD_SPECIFIC_GCLOUD_PROJECT" - value: "python-docs-samples-tests-py37" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-spanner/.kokoro/test-samples.sh" -} - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" -} - -# Download secrets for samples -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "python-spanner/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.7/continuous.cfg b/.kokoro/samples/python3.7/continuous.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.7/continuous.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.7/periodic-head.cfg b/.kokoro/samples/python3.7/periodic-head.cfg deleted file mode 100644 index b6133a1180..0000000000 --- a/.kokoro/samples/python3.7/periodic-head.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-spanner/.kokoro/test-samples-against-head.sh" -} diff --git a/.kokoro/samples/python3.7/periodic.cfg b/.kokoro/samples/python3.7/periodic.cfg deleted file mode 100644 index 71cd1e597e..0000000000 --- a/.kokoro/samples/python3.7/periodic.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "False" -} diff --git a/.kokoro/samples/python3.7/presubmit.cfg b/.kokoro/samples/python3.7/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.7/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/common.cfg b/.kokoro/samples/python3.8/common.cfg deleted file mode 100644 index 3f8d356809..0000000000 --- a/.kokoro/samples/python3.8/common.cfg +++ /dev/null @@ -1,40 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -# Build logs will be here -action { - define_artifacts { - regex: "**/*sponge_log.xml" - } -} - -# Specify which tests to run -env_vars: { - key: "RUN_TESTS_SESSION" - value: "py-3.8" -} - -# Declare build specific Cloud project. -env_vars: { - key: "BUILD_SPECIFIC_GCLOUD_PROJECT" - value: "python-docs-samples-tests-py38" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-spanner/.kokoro/test-samples.sh" -} - -# Configure the docker image for kokoro-trampoline. -env_vars: { - key: "TRAMPOLINE_IMAGE" - value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" -} - -# Download secrets for samples -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" - -# Download trampoline resources. -gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" - -# Use the trampoline script to run in docker. -build_file: "python-spanner/.kokoro/trampoline_v2.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.8/continuous.cfg b/.kokoro/samples/python3.8/continuous.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.8/continuous.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/periodic-head.cfg b/.kokoro/samples/python3.8/periodic-head.cfg deleted file mode 100644 index b6133a1180..0000000000 --- a/.kokoro/samples/python3.8/periodic-head.cfg +++ /dev/null @@ -1,11 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} - -env_vars: { - key: "TRAMPOLINE_BUILD_FILE" - value: "github/python-spanner/.kokoro/test-samples-against-head.sh" -} diff --git a/.kokoro/samples/python3.8/periodic.cfg b/.kokoro/samples/python3.8/periodic.cfg deleted file mode 100644 index 71cd1e597e..0000000000 --- a/.kokoro/samples/python3.8/periodic.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "False" -} diff --git a/.kokoro/samples/python3.8/presubmit.cfg b/.kokoro/samples/python3.8/presubmit.cfg deleted file mode 100644 index a1c8d9759c..0000000000 --- a/.kokoro/samples/python3.8/presubmit.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Format: //devtools/kokoro/config/proto/build.proto - -env_vars: { - key: "INSTALL_LIBRARY_FROM_SOURCE" - value: "True" -} \ No newline at end of file diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 608f4654f6..76e9061cd2 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -22,7 +22,7 @@ In order to add a feature: documentation. - The feature must work fully on the following CPython versions: - 3.7, 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows. + 3.9, 3.10, 3.11, 3.12 and 3.13 on both UNIX and Windows. - The feature must not add unnecessary dependencies (where "unnecessary" is of course subjective, but new dependencies should @@ -143,12 +143,12 @@ Running System Tests $ nox -s system # Run a single system test - $ nox -s system-3.8 -- -k + $ nox -s system-3.12 -- -k .. note:: - System tests are only configured to run under Python 3.8. + System tests are only configured to run under Python 3.12. For expediency, we do not run them in older versions of Python 3. This alone will not run the tests. You'll need to change some local @@ -195,11 +195,11 @@ configure them just like the System Tests. # Run all tests in a folder $ cd samples/samples - $ nox -s py-3.8 + $ nox -s py-3.9 # Run a single sample test $ cd samples/samples - $ nox -s py-3.8 -- -k + $ nox -s py-3.9 -- -k ******************************************** Note About ``README`` as it pertains to PyPI @@ -221,16 +221,12 @@ Supported Python Versions We support: -- `Python 3.7`_ -- `Python 3.8`_ - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ - `Python 3.12`_ - `Python 3.13`_ -.. _Python 3.7: https://docs.python.org/3.7/ -.. _Python 3.8: https://docs.python.org/3.8/ .. _Python 3.9: https://docs.python.org/3.9/ .. _Python 3.10: https://docs.python.org/3.10/ .. _Python 3.11: https://docs.python.org/3.11/ @@ -243,7 +239,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_. .. _config: https://github.com/googleapis/python-spanner/blob/main/noxfile.py -We also explicitly decided to support Python 3 beginning with version 3.7. +We also explicitly decided to support Python 3 beginning with version 3.9. Reasons for this include: - Encouraging use of newest versions of Python 3 diff --git a/README.rst b/README.rst index 085587e51d..2b1f7b0acd 100644 --- a/README.rst +++ b/README.rst @@ -56,14 +56,15 @@ dependencies. Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.7 +Python >= 3.9 Deprecated Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^ Python == 2.7. Python == 3.5. Python == 3.6. - +Python == 3.7. +Python == 3.8. Mac/Linux ^^^^^^^^^ diff --git a/noxfile.py b/noxfile.py index 107437249e..b101f46b2e 100644 --- a/noxfile.py +++ b/noxfile.py @@ -38,8 +38,6 @@ SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"] UNIT_TEST_PYTHON_VERSIONS: List[str] = [ - "3.7", - "3.8", "3.9", "3.10", "3.11", @@ -78,8 +76,6 @@ CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() nox.options.sessions = [ - # TODO(https://github.com/googleapis/python-spanner/issues/1392): - # Remove or restore testing for Python 3.7/3.8 "unit-3.9", "unit-3.10", "unit-3.11", @@ -516,11 +512,12 @@ def prerelease_deps(session, protobuf_implementation, database_dialect): constraints_deps = [ match.group(1) for match in re.finditer( - r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE + r"^\s*([a-zA-Z0-9._-]+)", constraints_text, flags=re.MULTILINE ) ] - session.install(*constraints_deps) + if constraints_deps: + session.install(*constraints_deps) prerel_deps = [ "protobuf", diff --git a/owlbot.py b/owlbot.py index ce4b00af28..cf460877a3 100644 --- a/owlbot.py +++ b/owlbot.py @@ -236,6 +236,8 @@ def get_staging_dirs( ".github/release-please.yml", ".kokoro/test-samples-impl.sh", ".kokoro/presubmit/presubmit.cfg", + ".kokoro/samples/python3.7/**", + ".kokoro/samples/python3.8/**", ], ) @@ -259,6 +261,17 @@ def get_staging_dirs( python.py_samples() +s.replace( + "samples/**/noxfile.py", + 'BLACK_VERSION = "black==22.3.0"', + 'BLACK_VERSION = "black==23.7.0"', +) +s.replace( + "samples/**/noxfile.py", + r'ALL_VERSIONS = \["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"\]', + 'ALL_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]', +) + # Use a python runtime which is available in the owlbot post processor here # https://github.com/googleapis/synthtool/blob/master/docker/owlbot/python/Dockerfile s.shell.run(["nox", "-s", "blacken-3.10"], hide_output=False) diff --git a/samples/samples/noxfile.py b/samples/samples/noxfile.py index a169b5b5b4..97dc6241e7 100644 --- a/samples/samples/noxfile.py +++ b/samples/samples/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==22.3.0" +BLACK_VERSION = "black==23.7.0" ISORT_VERSION = "isort==5.10.1" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. # All versions used to test samples. -ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] +ALL_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"] diff --git a/samples/samples/snippets.py b/samples/samples/snippets.py index 92fdd99132..87b7ab86a2 100644 --- a/samples/samples/snippets.py +++ b/samples/samples/snippets.py @@ -1591,9 +1591,9 @@ def __init__(self): super().__init__("commit_stats_sample") def info(self, msg, *args, **kwargs): - if kwargs["extra"] and "commit_stats" in kwargs["extra"]: + if "extra" in kwargs and kwargs["extra"] and "commit_stats" in kwargs["extra"]: self.last_commit_stats = kwargs["extra"]["commit_stats"] - super().info(msg) + super().info(msg, *args, **kwargs) spanner_client = spanner.Client() instance = spanner_client.instance(instance_id) diff --git a/samples/samples/snippets_test.py b/samples/samples/snippets_test.py index 01482518db..72f243fdb5 100644 --- a/samples/samples/snippets_test.py +++ b/samples/samples/snippets_test.py @@ -680,13 +680,20 @@ def test_write_with_dml_transaction(capsys, instance_id, sample_database): @pytest.mark.dependency(depends=["add_column"]) -def update_data_with_partitioned_dml(capsys, instance_id, sample_database): +def test_update_data_with_partitioned_dml(capsys, instance_id, sample_database): snippets.update_data_with_partitioned_dml(instance_id, sample_database.database_id) out, _ = capsys.readouterr() - assert "3 record(s) updated" in out + assert "3 records updated" in out -@pytest.mark.dependency(depends=["insert_with_dml"]) +@pytest.mark.dependency( + depends=[ + "insert_with_dml", + "dml_write_read_transaction", + "log_commit_stats", + "set_max_commit_delay", + ] +) def test_delete_data_with_partitioned_dml(capsys, instance_id, sample_database): snippets.delete_data_with_partitioned_dml(instance_id, sample_database.database_id) out, _ = capsys.readouterr() diff --git a/setup.py b/setup.py index a32883075b..858982f783 100644 --- a/setup.py +++ b/setup.py @@ -86,8 +86,6 @@ "License :: OSI Approved :: Apache Software License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", @@ -99,7 +97,7 @@ packages=packages, install_requires=dependencies, extras_require=extras, - python_requires=">=3.7", + python_requires=">=3.9", include_package_data=True, zip_safe=False, ) diff --git a/testing/constraints-3.7.txt b/testing/constraints-3.7.txt deleted file mode 100644 index 58482dcd03..0000000000 --- a/testing/constraints-3.7.txt +++ /dev/null @@ -1,20 +0,0 @@ -# This constraints file is used to check that lower bounds -# are correct in setup.py -# List all library dependencies and extras in this file. -# Pin the version to the lower bound. -# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev", -# Then this file should have google-cloud-foo==1.14.0 -google-api-core==1.34.0 -google-cloud-core==1.4.4 -grpc-google-iam-v1==0.12.4 -libcst==0.2.5 -proto-plus==1.22.0 -sqlparse==0.4.4 -opentelemetry-api==1.22.0 -opentelemetry-sdk==1.22.0 -opentelemetry-semantic-conventions==0.43b0 -protobuf==3.20.2 -deprecated==1.2.14 -grpc-interceptor==0.15.4 -google-cloud-monitoring==2.16.0 -mmh3==4.1.0 diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt deleted file mode 100644 index ad3f0fa58e..0000000000 --- a/testing/constraints-3.8.txt +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -# This constraints file is required for unit tests. -# List all library dependencies and extras in this file. -google-api-core -proto-plus -protobuf -grpc-google-iam-v1 From ee24c6ee2643bc74d52e9f0a924b80a830fa2697 Mon Sep 17 00:00:00 2001 From: skuruppu Date: Tue, 26 Aug 2025 20:44:12 +1000 Subject: [PATCH 2/6] feat(spanner): support setting read lock mode (#1404) Supports setting the read lock mode in R/W transactions at both the client level and at an individual transaction level. Co-authored-by: rahul2393 --- google/cloud/spanner_v1/batch.py | 10 +- google/cloud/spanner_v1/database.py | 11 ++ google/cloud/spanner_v1/session.py | 3 + google/cloud/spanner_v1/transaction.py | 14 +- tests/unit/test__helpers.py | 71 +++++++- tests/unit/test_batch.py | 25 +++ tests/unit/test_client.py | 3 +- tests/unit/test_session.py | 237 +++++++++++++++++++++++++ tests/unit/test_spanner.py | 69 ++++++- 9 files changed, 436 insertions(+), 7 deletions(-) diff --git a/google/cloud/spanner_v1/batch.py b/google/cloud/spanner_v1/batch.py index ab58bdec7a..0792e600dc 100644 --- a/google/cloud/spanner_v1/batch.py +++ b/google/cloud/spanner_v1/batch.py @@ -149,6 +149,7 @@ def commit( max_commit_delay=None, exclude_txn_from_change_streams=False, isolation_level=TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED, timeout_secs=DEFAULT_RETRY_TIMEOUT_SECS, default_retry_delay=None, ): @@ -182,6 +183,11 @@ def commit( :param isolation_level: (Optional) Sets isolation level for the transaction. + :type read_lock_mode: + :class:`google.cloud.spanner_v1.types.TransactionOptions.ReadWrite.ReadLockMode` + :param read_lock_mode: + (Optional) Sets the read lock mode for this transaction. + :type timeout_secs: int :param timeout_secs: (Optional) The maximum time in seconds to wait for the commit to complete. @@ -208,7 +214,9 @@ def commit( _metadata_with_leader_aware_routing(database._route_to_leader_enabled) ) txn_options = TransactionOptions( - read_write=TransactionOptions.ReadWrite(), + read_write=TransactionOptions.ReadWrite( + read_lock_mode=read_lock_mode, + ), exclude_txn_from_change_streams=exclude_txn_from_change_streams, isolation_level=isolation_level, ) diff --git a/google/cloud/spanner_v1/database.py b/google/cloud/spanner_v1/database.py index 9055631e37..215cd5bed8 100644 --- a/google/cloud/spanner_v1/database.py +++ b/google/cloud/spanner_v1/database.py @@ -882,6 +882,7 @@ def batch( max_commit_delay=None, exclude_txn_from_change_streams=False, isolation_level=TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED, **kw, ): """Return an object which wraps a batch. @@ -914,6 +915,11 @@ def batch( :param isolation_level: (Optional) Sets the isolation level for this transaction. This overrides any default isolation level set for the client. + :type read_lock_mode: + :class:`google.cloud.spanner_v1.types.TransactionOptions.ReadWrite.ReadLockMode` + :param read_lock_mode: + (Optional) Sets the read lock mode for this transaction. This overrides any default read lock mode set for the client. + :rtype: :class:`~google.cloud.spanner_v1.database.BatchCheckout` :returns: new wrapper """ @@ -924,6 +930,7 @@ def batch( max_commit_delay, exclude_txn_from_change_streams, isolation_level, + read_lock_mode, **kw, ) @@ -996,6 +1003,7 @@ def run_in_transaction(self, func, *args, **kw): This does not exclude the transaction from being recorded in the change streams with the DDL option `allow_txn_exclusion` being false or unset. "isolation_level" sets the isolation level for the transaction. + "read_lock_mode" sets the read lock mode for the transaction. :rtype: Any :returns: The return value of ``func``. @@ -1310,6 +1318,7 @@ def __init__( max_commit_delay=None, exclude_txn_from_change_streams=False, isolation_level=TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED, **kw, ): self._database: Database = database @@ -1325,6 +1334,7 @@ def __init__( self._max_commit_delay = max_commit_delay self._exclude_txn_from_change_streams = exclude_txn_from_change_streams self._isolation_level = isolation_level + self._read_lock_mode = read_lock_mode self._kw = kw def __enter__(self): @@ -1357,6 +1367,7 @@ def __exit__(self, exc_type, exc_val, exc_tb): max_commit_delay=self._max_commit_delay, exclude_txn_from_change_streams=self._exclude_txn_from_change_streams, isolation_level=self._isolation_level, + read_lock_mode=self._read_lock_mode, **self._kw, ) finally: diff --git a/google/cloud/spanner_v1/session.py b/google/cloud/spanner_v1/session.py index 09f472bbe5..7b6634c728 100644 --- a/google/cloud/spanner_v1/session.py +++ b/google/cloud/spanner_v1/session.py @@ -509,6 +509,7 @@ def run_in_transaction(self, func, *args, **kw): This does not exclude the transaction from being recorded in the change streams with the DDL option `allow_txn_exclusion` being false or unset. "isolation_level" sets the isolation level for the transaction. + "read_lock_mode" sets the read lock mode for the transaction. :rtype: Any :returns: The return value of ``func``. @@ -525,6 +526,7 @@ def run_in_transaction(self, func, *args, **kw): "exclude_txn_from_change_streams", None ) isolation_level = kw.pop("isolation_level", None) + read_lock_mode = kw.pop("read_lock_mode", None) database = self._database log_commit_stats = database.log_commit_stats @@ -549,6 +551,7 @@ def run_in_transaction(self, func, *args, **kw): txn.transaction_tag = transaction_tag txn.exclude_txn_from_change_streams = exclude_txn_from_change_streams txn.isolation_level = isolation_level + txn.read_lock_mode = read_lock_mode if self.is_multiplexed: txn._multiplexed_session_previous_transaction_id = ( diff --git a/google/cloud/spanner_v1/transaction.py b/google/cloud/spanner_v1/transaction.py index 5db809f91c..5dd54eafe1 100644 --- a/google/cloud/spanner_v1/transaction.py +++ b/google/cloud/spanner_v1/transaction.py @@ -61,6 +61,9 @@ class Transaction(_SnapshotBase, _BatchBase): isolation_level: TransactionOptions.IsolationLevel = ( TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED ) + read_lock_mode: TransactionOptions.ReadWrite.ReadLockMode = ( + TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED + ) # Override defaults from _SnapshotBase. _multi_use: bool = True @@ -89,7 +92,8 @@ def _build_transaction_options_pb(self) -> TransactionOptions: merge_transaction_options = TransactionOptions( read_write=TransactionOptions.ReadWrite( - multiplexed_session_previous_transaction_id=self._multiplexed_session_previous_transaction_id + multiplexed_session_previous_transaction_id=self._multiplexed_session_previous_transaction_id, + read_lock_mode=self.read_lock_mode, ), exclude_txn_from_change_streams=self.exclude_txn_from_change_streams, isolation_level=self.isolation_level, @@ -784,6 +788,9 @@ class BatchTransactionId: @dataclass class DefaultTransactionOptions: isolation_level: str = TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED + read_lock_mode: str = ( + TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED + ) _defaultReadWriteTransactionOptions: Optional[TransactionOptions] = field( init=False, repr=False ) @@ -791,7 +798,10 @@ class DefaultTransactionOptions: def __post_init__(self): """Initialize _defaultReadWriteTransactionOptions automatically""" self._defaultReadWriteTransactionOptions = TransactionOptions( - isolation_level=self.isolation_level + read_write=TransactionOptions.ReadWrite( + read_lock_mode=self.read_lock_mode, + ), + isolation_level=self.isolation_level, ) @property diff --git a/tests/unit/test__helpers.py b/tests/unit/test__helpers.py index d29f030e55..6f77d002cd 100644 --- a/tests/unit/test__helpers.py +++ b/tests/unit/test__helpers.py @@ -978,7 +978,10 @@ def test_default_none_and_merge_none(self): def test_default_options_and_merge_none(self): default = TransactionOptions( - isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ + isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ, + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.PESSIMISTIC, + ), ) merge = None result = self._callFUT(default, merge) @@ -988,7 +991,10 @@ def test_default_options_and_merge_none(self): def test_default_none_and_merge_options(self): default = None merge = TransactionOptions( - isolation_level=TransactionOptions.IsolationLevel.SERIALIZABLE + isolation_level=TransactionOptions.IsolationLevel.SERIALIZABLE, + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), ) expected = merge result = self._callFUT(default, merge) @@ -1044,6 +1050,67 @@ def test_default_isolation_and_merge_options_isolation_unspecified(self): result = self._callFUT(default, merge) self.assertEqual(result, expected) + def test_default_and_merge_read_lock_mode_options(self): + default = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.PESSIMISTIC, + ), + ) + merge = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + exclude_txn_from_change_streams=True, + ) + expected = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + exclude_txn_from_change_streams=True, + ) + result = self._callFUT(default, merge) + self.assertEqual(result, expected) + + def test_default_read_lock_mode_and_merge_options(self): + default = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + ) + merge = TransactionOptions( + read_write=TransactionOptions.ReadWrite(), + exclude_txn_from_change_streams=True, + ) + expected = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + exclude_txn_from_change_streams=True, + ) + result = self._callFUT(default, merge) + self.assertEqual(result, expected) + + def test_default_read_lock_mode_and_merge_options_isolation_unspecified(self): + default = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + ) + merge = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED, + ), + exclude_txn_from_change_streams=True, + ) + expected = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + exclude_txn_from_change_streams=True, + ) + result = self._callFUT(default, merge) + self.assertEqual(result, expected) + class Test_interval(unittest.TestCase): from google.protobuf.struct_pb2 import Value diff --git a/tests/unit/test_batch.py b/tests/unit/test_batch.py index 2056581d6f..1582fcf4a9 100644 --- a/tests/unit/test_batch.py +++ b/tests/unit/test_batch.py @@ -300,6 +300,7 @@ def _test_commit_with_options( max_commit_delay_in=None, exclude_txn_from_change_streams=False, isolation_level=TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED, ): now = datetime.datetime.utcnow().replace(tzinfo=UTC) now_pb = _datetime_to_pb_timestamp(now) @@ -315,6 +316,7 @@ def _test_commit_with_options( max_commit_delay=max_commit_delay_in, exclude_txn_from_change_streams=exclude_txn_from_change_streams, isolation_level=isolation_level, + read_lock_mode=read_lock_mode, ) self.assertEqual(committed, now) @@ -347,6 +349,10 @@ def _test_commit_with_options( single_use_txn.isolation_level, isolation_level, ) + self.assertEqual( + single_use_txn.read_write.read_lock_mode, + read_lock_mode, + ) req_id = f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1" self.assertEqual( metadata, @@ -424,6 +430,25 @@ def test_commit_w_isolation_level(self): isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ, ) + def test_commit_w_read_lock_mode(self): + request_options = RequestOptions( + request_tag="tag-1", + ) + self._test_commit_with_options( + request_options=request_options, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ) + + def test_commit_w_isolation_level_and_read_lock_mode(self): + request_options = RequestOptions( + request_tag="tag-1", + ) + self._test_commit_with_options( + request_options=request_options, + isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.PESSIMISTIC, + ) + def test_context_mgr_already_committed(self): now = datetime.datetime.utcnow().replace(tzinfo=UTC) database = _Database() diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py index dd6e6a6b8d..212dc9ee4f 100644 --- a/tests/unit/test_client.py +++ b/tests/unit/test_client.py @@ -46,7 +46,8 @@ class TestClient(unittest.TestCase): }, } DEFAULT_TRANSACTION_OPTIONS = DefaultTransactionOptions( - isolation_level="SERIALIZABLE" + isolation_level="SERIALIZABLE", + read_lock_mode="PESSIMISTIC", ) def _get_target_class(self): diff --git a/tests/unit/test_session.py b/tests/unit/test_session.py index d5b9b83478..3b08cc5c65 100644 --- a/tests/unit/test_session.py +++ b/tests/unit/test_session.py @@ -2310,6 +2310,243 @@ def unit_of_work(txn, *args, **kw): ], ) + def test_run_in_transaction_w_read_lock_mode_at_request(self): + database = self._make_database() + api = database.spanner_api = build_spanner_api() + session = self._make_one(database) + session._session_id = self.SESSION_ID + + def unit_of_work(txn, *args, **kw): + txn.insert("test", [], []) + return 42 + + return_value = session.run_in_transaction( + unit_of_work, "abc", read_lock_mode="OPTIMISTIC" + ) + + self.assertEqual(return_value, 42) + + expected_options = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + ) + api.begin_transaction.assert_called_once_with( + request=BeginTransactionRequest( + session=self.SESSION_NAME, options=expected_options + ), + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + + def test_run_in_transaction_w_read_lock_mode_at_client(self): + database = self._make_database( + default_transaction_options=DefaultTransactionOptions( + read_lock_mode="OPTIMISTIC" + ) + ) + api = database.spanner_api = build_spanner_api() + session = self._make_one(database) + session._session_id = self.SESSION_ID + + def unit_of_work(txn, *args, **kw): + txn.insert("test", [], []) + return 42 + + return_value = session.run_in_transaction(unit_of_work, "abc") + + self.assertEqual(return_value, 42) + + expected_options = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + ) + api.begin_transaction.assert_called_once_with( + request=BeginTransactionRequest( + session=self.SESSION_NAME, options=expected_options + ), + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + + def test_run_in_transaction_w_read_lock_mode_at_request_overrides_client(self): + database = self._make_database( + default_transaction_options=DefaultTransactionOptions( + read_lock_mode="PESSIMISTIC" + ) + ) + api = database.spanner_api = build_spanner_api() + session = self._make_one(database) + session._session_id = self.SESSION_ID + + def unit_of_work(txn, *args, **kw): + txn.insert("test", [], []) + return 42 + + return_value = session.run_in_transaction( + unit_of_work, + "abc", + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ) + + self.assertEqual(return_value, 42) + + expected_options = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + ) + api.begin_transaction.assert_called_once_with( + request=BeginTransactionRequest( + session=self.SESSION_NAME, options=expected_options + ), + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + + def test_run_in_transaction_w_isolation_level_and_read_lock_mode_at_request(self): + database = self._make_database() + api = database.spanner_api = build_spanner_api() + session = self._make_one(database) + session._session_id = self.SESSION_ID + + def unit_of_work(txn, *args, **kw): + txn.insert("test", [], []) + return 42 + + return_value = session.run_in_transaction( + unit_of_work, + "abc", + read_lock_mode="PESSIMISTIC", + isolation_level="REPEATABLE_READ", + ) + + self.assertEqual(return_value, 42) + + expected_options = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.PESSIMISTIC, + ), + isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ, + ) + api.begin_transaction.assert_called_once_with( + request=BeginTransactionRequest( + session=self.SESSION_NAME, options=expected_options + ), + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + + def test_run_in_transaction_w_isolation_level_and_read_lock_mode_at_client(self): + database = self._make_database( + default_transaction_options=DefaultTransactionOptions( + read_lock_mode="PESSIMISTIC", + isolation_level="REPEATABLE_READ", + ) + ) + api = database.spanner_api = build_spanner_api() + session = self._make_one(database) + session._session_id = self.SESSION_ID + + def unit_of_work(txn, *args, **kw): + txn.insert("test", [], []) + return 42 + + return_value = session.run_in_transaction(unit_of_work, "abc") + + self.assertEqual(return_value, 42) + + expected_options = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.PESSIMISTIC, + ), + isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ, + ) + api.begin_transaction.assert_called_once_with( + request=BeginTransactionRequest( + session=self.SESSION_NAME, options=expected_options + ), + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + + def test_run_in_transaction_w_isolation_level_and_read_lock_mode_at_request_overrides_client( + self, + ): + database = self._make_database( + default_transaction_options=DefaultTransactionOptions( + read_lock_mode="PESSIMISTIC", + isolation_level="REPEATABLE_READ", + ) + ) + api = database.spanner_api = build_spanner_api() + session = self._make_one(database) + session._session_id = self.SESSION_ID + + def unit_of_work(txn, *args, **kw): + txn.insert("test", [], []) + return 42 + + return_value = session.run_in_transaction( + unit_of_work, + "abc", + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + isolation_level=TransactionOptions.IsolationLevel.SERIALIZABLE, + ) + + self.assertEqual(return_value, 42) + + expected_options = TransactionOptions( + read_write=TransactionOptions.ReadWrite( + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + isolation_level=TransactionOptions.IsolationLevel.SERIALIZABLE, + ) + api.begin_transaction.assert_called_once_with( + request=BeginTransactionRequest( + session=self.SESSION_NAME, options=expected_options + ), + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + def test_delay_helper_w_no_delay(self): metadata_mock = mock.Mock() metadata_mock.trailing_metadata.return_value = {} diff --git a/tests/unit/test_spanner.py b/tests/unit/test_spanner.py index eedf49d3ff..e35b817858 100644 --- a/tests/unit/test_spanner.py +++ b/tests/unit/test_spanner.py @@ -142,6 +142,7 @@ def _execute_update_helper( query_options=None, exclude_txn_from_change_streams=False, isolation_level=TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED, ): stats_pb = ResultSetStats(row_count_exact=1) @@ -152,6 +153,7 @@ def _execute_update_helper( transaction.transaction_tag = self.TRANSACTION_TAG transaction.exclude_txn_from_change_streams = exclude_txn_from_change_streams transaction.isolation_level = isolation_level + transaction.read_lock_mode = read_lock_mode transaction._execute_sql_request_count = count row_count = transaction.execute_update( @@ -174,11 +176,14 @@ def _execute_update_expected_request( count=0, exclude_txn_from_change_streams=False, isolation_level=TransactionOptions.IsolationLevel.ISOLATION_LEVEL_UNSPECIFIED, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.READ_LOCK_MODE_UNSPECIFIED, ): if begin is True: expected_transaction = TransactionSelector( begin=TransactionOptions( - read_write=TransactionOptions.ReadWrite(), + read_write=TransactionOptions.ReadWrite( + read_lock_mode=read_lock_mode + ), exclude_txn_from_change_streams=exclude_txn_from_change_streams, isolation_level=isolation_level, ) @@ -648,6 +653,68 @@ def test_transaction_should_include_begin_w_isolation_level_with_first_update( ], ) + def test_transaction_should_include_begin_w_read_lock_mode_with_first_update( + self, + ): + database = _Database() + session = _Session(database) + api = database.spanner_api = self._make_spanner_api() + transaction = self._make_one(session) + self._execute_update_helper( + transaction=transaction, + api=api, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ) + + api.execute_sql.assert_called_once_with( + request=self._execute_update_expected_request( + database=database, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.OPTIMISTIC, + ), + retry=RETRY, + timeout=TIMEOUT, + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + + def test_transaction_should_include_begin_w_isolation_level_and_read_lock_mode_with_first_update( + self, + ): + database = _Database() + session = _Session(database) + api = database.spanner_api = self._make_spanner_api() + transaction = self._make_one(session) + self._execute_update_helper( + transaction=transaction, + api=api, + isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.PESSIMISTIC, + ) + + api.execute_sql.assert_called_once_with( + request=self._execute_update_expected_request( + database=database, + isolation_level=TransactionOptions.IsolationLevel.REPEATABLE_READ, + read_lock_mode=TransactionOptions.ReadWrite.ReadLockMode.PESSIMISTIC, + ), + retry=RETRY, + timeout=TIMEOUT, + metadata=[ + ("google-cloud-resource-prefix", database.name), + ("x-goog-spanner-route-to-leader", "true"), + ( + "x-goog-spanner-request-id", + f"1.{REQ_RAND_PROCESS_ID}.{database._nth_client_id}.{database._channel_id}.1.1", + ), + ], + ) + def test_transaction_should_use_transaction_id_if_error_with_first_batch_update( self, ): From 069138de3d97891836c916a47b99b898deddc8d6 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Wed, 27 Aug 2025 07:47:26 +0200 Subject: [PATCH 3/6] chore(deps): update all dependencies (#1283) --- .devcontainer/Dockerfile | 2 +- .devcontainer/requirements.txt | 78 +++++++++++++------ ...against-emulator-with-regular-session.yaml | 4 +- .../integration-tests-against-emulator.yaml | 4 +- .github/workflows/mock_server_tests.yaml | 4 +- .github/workflows/presubmit.yaml | 6 +- samples/samples/requirements-test.txt | 6 +- samples/samples/requirements.txt | 2 +- 8 files changed, 68 insertions(+), 38 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ce36ab9157..9d27c2353f 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -ARG VARIANT="3.12" +ARG VARIANT="3.13" FROM mcr.microsoft.com/devcontainers/python:${VARIANT} #install nox diff --git a/.devcontainer/requirements.txt b/.devcontainer/requirements.txt index 8547321c28..ac5aae60d9 100644 --- a/.devcontainer/requirements.txt +++ b/.devcontainer/requirements.txt @@ -4,39 +4,69 @@ # # pip-compile --generate-hashes requirements.in # -argcomplete==3.5.1 \ - --hash=sha256:1a1d148bdaa3e3b93454900163403df41448a248af01b6e849edc5ac08e6c363 \ - --hash=sha256:eb1ee355aa2557bd3d0145de7b06b2a45b0ce461e1e7813f5d066039ab4177b4 +argcomplete==3.6.2 \ + --hash=sha256:65b3133a29ad53fb42c48cf5114752c7ab66c1c38544fdf6460f450c09b42591 \ + --hash=sha256:d0519b1bc867f5f4f4713c41ad0aba73a4a5f007449716b16f385f2166dc6adf # via nox colorlog==6.9.0 \ --hash=sha256:5906e71acd67cb07a71e779c47c4bcb45fb8c2993eebe9e5adcd6a6f1b283eff \ --hash=sha256:bfba54a1b93b94f54e1f4fe48395725a3d92fd2a4af702f6bd70946bdc0c6ac2 # via nox -distlib==0.3.9 \ - --hash=sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87 \ - --hash=sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403 +distlib==0.4.0 \ + --hash=sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16 \ + --hash=sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d # via virtualenv -filelock==3.16.1 \ - --hash=sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0 \ - --hash=sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435 +filelock==3.19.1 \ + --hash=sha256:66eda1888b0171c998b35be2bcc0f6d75c388a7ce20c3f3f37aa8e96c2dddf58 \ + --hash=sha256:d38e30481def20772f5baf097c122c3babc4fcdb7e14e57049eb9d88c6dc017d # via virtualenv -nox==2024.10.9 \ - --hash=sha256:1d36f309a0a2a853e9bccb76bbef6bb118ba92fa92674d15604ca99adeb29eab \ - --hash=sha256:7aa9dc8d1c27e9f45ab046ffd1c3b2c4f7c91755304769df231308849ebded95 +nox==2025.5.1 \ + --hash=sha256:2a571dfa7a58acc726521ac3cd8184455ebcdcbf26401c7b737b5bc6701427b2 \ + --hash=sha256:56abd55cf37ff523c254fcec4d152ed51e5fe80e2ab8317221d8b828ac970a31 # via -r requirements.in -packaging==24.1 \ - --hash=sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002 \ - --hash=sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124 +packaging==25.0 \ + --hash=sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484 \ + --hash=sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f # via nox -platformdirs==4.3.6 \ - --hash=sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907 \ - --hash=sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb +platformdirs==4.4.0 \ + --hash=sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85 \ + --hash=sha256:ca753cf4d81dc309bc67b0ea38fd15dc97bc30ce419a7f58d13eb3bf14c4febf # via virtualenv -tomli==2.0.2 \ - --hash=sha256:2ebe24485c53d303f690b0ec092806a085f07af5a5aa1464f3931eec36caaa38 \ - --hash=sha256:d46d457a85337051c36524bc5349dd91b1877838e2979ac5ced3e710ed8a60ed +tomli==2.2.1 \ + --hash=sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6 \ + --hash=sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd \ + --hash=sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c \ + --hash=sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b \ + --hash=sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8 \ + --hash=sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6 \ + --hash=sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77 \ + --hash=sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff \ + --hash=sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea \ + --hash=sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192 \ + --hash=sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249 \ + --hash=sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee \ + --hash=sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4 \ + --hash=sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98 \ + --hash=sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8 \ + --hash=sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4 \ + --hash=sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281 \ + --hash=sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744 \ + --hash=sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69 \ + --hash=sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13 \ + --hash=sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140 \ + --hash=sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e \ + --hash=sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e \ + --hash=sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc \ + --hash=sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff \ + --hash=sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec \ + --hash=sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2 \ + --hash=sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222 \ + --hash=sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106 \ + --hash=sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272 \ + --hash=sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a \ + --hash=sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7 # via nox -virtualenv==20.27.1 \ - --hash=sha256:142c6be10212543b32c6c45d3d3893dff89112cc588b7d0879ae5a1ec03a47ba \ - --hash=sha256:f11f1b8a29525562925f745563bfd48b189450f61fb34c4f9cc79dd5aa32a1f4 +virtualenv==20.34.0 \ + --hash=sha256:341f5afa7eee943e4984a9207c025feedd768baff6753cd660c857ceb3e36026 \ + --hash=sha256:44815b2c9dee7ed86e387b842a84f20b93f7f417f95886ca1996a72a4138eb1a # via nox diff --git a/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml b/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml index 8b77ebb768..e5b08b7022 100644 --- a/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml +++ b/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml @@ -17,11 +17,11 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install nox run: python -m pip install nox - name: Run system tests diff --git a/.github/workflows/integration-tests-against-emulator.yaml b/.github/workflows/integration-tests-against-emulator.yaml index d74aa0fa00..109e21f2ef 100644 --- a/.github/workflows/integration-tests-against-emulator.yaml +++ b/.github/workflows/integration-tests-against-emulator.yaml @@ -17,11 +17,11 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install nox run: python -m pip install nox - name: Run system tests diff --git a/.github/workflows/mock_server_tests.yaml b/.github/workflows/mock_server_tests.yaml index e93ac9905c..c720c97451 100644 --- a/.github/workflows/mock_server_tests.yaml +++ b/.github/workflows/mock_server_tests.yaml @@ -10,11 +10,11 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: 3.13 - name: Install nox run: python -m pip install nox - name: Run mock server tests diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index ab674fd370..435b12b8e0 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -13,11 +13,11 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.9 + python-version: 3.13 - name: Install nox run: python -m pip install nox - name: Check formatting @@ -31,7 +31,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Python uses: actions/setup-python@v5 with: diff --git a/samples/samples/requirements-test.txt b/samples/samples/requirements-test.txt index 8aa23a8189..921628caad 100644 --- a/samples/samples/requirements-test.txt +++ b/samples/samples/requirements-test.txt @@ -1,4 +1,4 @@ -pytest==8.3.3 +pytest==8.4.1 pytest-dependency==0.6.0 -mock==5.1.0 -google-cloud-testutils==1.4.0 +mock==5.2.0 +google-cloud-testutils==1.6.4 diff --git a/samples/samples/requirements.txt b/samples/samples/requirements.txt index 4009a0a00b..58cf3064bb 100644 --- a/samples/samples/requirements.txt +++ b/samples/samples/requirements.txt @@ -1,2 +1,2 @@ -google-cloud-spanner==3.50.0 +google-cloud-spanner==3.57.0 futures==3.4.0; python_version < "3" From 1813a8e40101b51648091fb67e16ed24efe2657d Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 4 Sep 2025 10:42:03 +0200 Subject: [PATCH 4/6] chore(deps): update actions/setup-python action to v6 (#1407) --- ...tegration-tests-against-emulator-with-regular-session.yaml | 2 +- .github/workflows/integration-tests-against-emulator.yaml | 2 +- .github/workflows/mock_server_tests.yaml | 2 +- .github/workflows/presubmit.yaml | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml b/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml index e5b08b7022..826a3b7629 100644 --- a/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml +++ b/.github/workflows/integration-tests-against-emulator-with-regular-session.yaml @@ -19,7 +19,7 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13 - name: Install nox diff --git a/.github/workflows/integration-tests-against-emulator.yaml b/.github/workflows/integration-tests-against-emulator.yaml index 109e21f2ef..e7158307b8 100644 --- a/.github/workflows/integration-tests-against-emulator.yaml +++ b/.github/workflows/integration-tests-against-emulator.yaml @@ -19,7 +19,7 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13 - name: Install nox diff --git a/.github/workflows/mock_server_tests.yaml b/.github/workflows/mock_server_tests.yaml index c720c97451..b705c98191 100644 --- a/.github/workflows/mock_server_tests.yaml +++ b/.github/workflows/mock_server_tests.yaml @@ -12,7 +12,7 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13 - name: Install nox diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 435b12b8e0..67db6136d1 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -15,7 +15,7 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: 3.13 - name: Install nox @@ -33,7 +33,7 @@ jobs: - name: Checkout code uses: actions/checkout@v5 - name: Setup Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{matrix.python}} - name: Install nox From a041042d8bd32a38e24e611c572df4e0bb886263 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 10 Sep 2025 13:00:29 +0530 Subject: [PATCH 5/6] chore: Update gapic-generator-python to 1.26.2 (#1406) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update Python generator version to 1.25.1 PiperOrigin-RevId: 800535761 Source-Link: https://github.com/googleapis/googleapis/commit/4cf1f99cccc014627af5e8a6c0f80a3e6ec0d268 Source-Link: https://github.com/googleapis/googleapis-gen/commit/133d25b68e712116e1c5dc71fc3eb3c5e717022a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTMzZDI1YjY4ZTcxMjExNmUxYzVkYzcxZmMzZWIzYzVlNzE3MDIyYSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: A comment for field `ranges` in message `.google.spanner.v1.KeySet` is changed docs: A comment for message `Mutation` is changed docs: A comment for field `columns` in message `.google.spanner.v1.Mutation` is changed docs: A comment for field `values` in message `.google.spanner.v1.Mutation` is changed docs: A comment for field `key_set` in message `.google.spanner.v1.Mutation` is changed docs: A comment for field `insert_or_update` in message `.google.spanner.v1.Mutation` is changed docs: A comment for field `replace` in message `.google.spanner.v1.Mutation` is changed docs: A comment for message `PlanNode` is changed docs: A comment for enum `Kind` is changed docs: A comment for field `variable` in message `.google.spanner.v1.PlanNode` is changed docs: A comment for field `index` in message `.google.spanner.v1.PlanNode` is changed docs: A comment for field `kind` in message `.google.spanner.v1.PlanNode` is changed docs: A comment for field `short_representation` in message `.google.spanner.v1.PlanNode` is changed docs: A comment for field `plan_nodes` in message `.google.spanner.v1.QueryPlan` is changed docs: A comment for method `CreateSession` in service `Spanner` is changed docs: A comment for method `GetSession` in service `Spanner` is changed docs: A comment for method `DeleteSession` in service `Spanner` is changed docs: A comment for method `ExecuteSql` in service `Spanner` is changed docs: A comment for method `ExecuteStreamingSql` in service `Spanner` is changed docs: A comment for method `Read` in service `Spanner` is changed docs: A comment for method `Commit` in service `Spanner` is changed docs: A comment for method `Rollback` in service `Spanner` is changed docs: A comment for method `PartitionQuery` in service `Spanner` is changed docs: A comment for method `PartitionRead` in service `Spanner` is changed docs: A comment for method `BatchWrite` in service `Spanner` is changed docs: A comment for field `session_template` in message `.google.spanner.v1.BatchCreateSessionsRequest` is changed docs: A comment for field `session_count` in message `.google.spanner.v1.BatchCreateSessionsRequest` is changed docs: A comment for field `approximate_last_use_time` in message `.google.spanner.v1.Session` is changed docs: A comment for field `multiplexed` in message `.google.spanner.v1.Session` is changed docs: A comment for enum `Priority` is changed docs: A comment for field `request_tag` in message `.google.spanner.v1.RequestOptions` is changed docs: A comment for field `transaction_tag` in message `.google.spanner.v1.RequestOptions` is changed docs: A comment for message `DirectedReadOptions` is changed docs: A comment for message `DirectedReadOptions` is changed docs: A comment for message `DirectedReadOptions` is changed docs: A comment for field `location` in message `.google.spanner.v1.DirectedReadOptions` is changed docs: A comment for field `auto_failover_disabled` in message `.google.spanner.v1.DirectedReadOptions` is changed docs: A comment for field `include_replicas` in message `.google.spanner.v1.DirectedReadOptions` is changed docs: A comment for field `exclude_replicas` in message `.google.spanner.v1.DirectedReadOptions` is changed docs: A comment for enum value `PROFILE` in enum `QueryMode` is changed docs: A comment for field `optimizer_version` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `optimizer_statistics_package` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `transaction` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `params` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `param_types` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `partition_token` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `seqno` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `data_boost_enabled` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `last_statement` in message `.google.spanner.v1.ExecuteSqlRequest` is changed docs: A comment for field `params` in message `.google.spanner.v1.ExecuteBatchDmlRequest` is changed docs: A comment for field `param_types` in message `.google.spanner.v1.ExecuteBatchDmlRequest` is changed docs: A comment for field `seqno` in message `.google.spanner.v1.ExecuteBatchDmlRequest` is changed docs: A comment for field `last_statements` in message `.google.spanner.v1.ExecuteBatchDmlRequest` is changed docs: A comment for field `precommit_token` in message `.google.spanner.v1.ExecuteBatchDmlResponse` is changed docs: A comment for message `PartitionOptions` is changed docs: A comment for field `partition_size_bytes` in message `.google.spanner.v1.PartitionOptions` is changed docs: A comment for field `max_partitions` in message `.google.spanner.v1.PartitionOptions` is changed docs: A comment for field `transaction` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `sql` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `params` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `param_types` in message `.google.spanner.v1.PartitionQueryRequest` is changed docs: A comment for field `key_set` in message `.google.spanner.v1.PartitionReadRequest` is changed docs: A comment for field `partition_token` in message `.google.spanner.v1.Partition` is changed docs: A comment for enum value `ORDER_BY_UNSPECIFIED` in enum `OrderBy` is changed docs: A comment for enum value `ORDER_BY_PRIMARY_KEY` in enum `OrderBy` is changed docs: A comment for enum value `LOCK_HINT_UNSPECIFIED` in enum `LockHint` is changed docs: A comment for enum value `LOCK_HINT_EXCLUSIVE` in enum `LockHint` is changed docs: A comment for field `key_set` in message `.google.spanner.v1.ReadRequest` is changed docs: A comment for field `limit` in message `.google.spanner.v1.ReadRequest` is changed docs: A comment for field `partition_token` in message `.google.spanner.v1.ReadRequest` is changed docs: A comment for field `data_boost_enabled` in message `.google.spanner.v1.ReadRequest` is changed docs: A comment for field `order_by` in message `.google.spanner.v1.ReadRequest` is changed docs: A comment for field `request_options` in message `.google.spanner.v1.BeginTransactionRequest` is changed docs: A comment for field `mutation_key` in message `.google.spanner.v1.BeginTransactionRequest` is changed docs: A comment for field `single_use_transaction` in message `.google.spanner.v1.CommitRequest` is changed docs: A comment for field `return_commit_stats` in message `.google.spanner.v1.CommitRequest` is changed docs: A comment for field `max_commit_delay` in message `.google.spanner.v1.CommitRequest` is changed docs: A comment for field `precommit_token` in message `.google.spanner.v1.CommitRequest` is changed docs: A comment for field `exclude_txn_from_change_streams` in message `.google.spanner.v1.BatchWriteRequest` is changed docs: A comment for enum value `SERIALIZABLE` in enum `IsolationLevel` is changed PiperOrigin-RevId: 800749899 Source-Link: https://github.com/googleapis/googleapis/commit/39c8072aee5d0df052b20db3d7ee74e3fb82aa14 Source-Link: https://github.com/googleapis/googleapis-gen/commit/42cfcdbbab1cbe12f4e09689591f9dff069f087e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDJjZmNkYmJhYjFjYmUxMmY0ZTA5Njg5NTkxZjlkZmYwNjlmMDg3ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Update gapic-generator-python to 1.26.2 PiperOrigin-RevId: 802200836 Source-Link: https://github.com/googleapis/googleapis/commit/d300b151a973ce0425ae4ad07b3de957ca31bec6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/a1ff0ae72ddcb68a259215d8c77661e2cdbb9b02 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYTFmZjBhZTcyZGRjYjY4YTI1OTIxNWQ4Yzc3NjYxZTJjZGJiOWIwMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot Co-authored-by: rahul2393 --- .../services/database_admin/async_client.py | 60 +-- .../services/database_admin/client.py | 60 +-- .../database_admin/transports/grpc.py | 42 +- .../database_admin/transports/grpc_asyncio.py | 42 +- .../database_admin/transports/rest.py | 8 +- .../spanner_admin_database_v1/types/backup.py | 228 +++++---- .../types/backup_schedule.py | 18 +- .../spanner_admin_database_v1/types/common.py | 22 +- .../types/spanner_database_admin.py | 82 ++-- .../services/instance_admin/async_client.py | 259 +++++----- .../services/instance_admin/client.py | 259 +++++----- .../instance_admin/transports/grpc.py | 243 +++++---- .../instance_admin/transports/grpc_asyncio.py | 243 +++++---- .../types/spanner_instance_admin.py | 200 ++++---- .../services/spanner/async_client.py | 97 ++-- .../spanner_v1/services/spanner/client.py | 97 ++-- .../services/spanner/transports/grpc.py | 83 ++-- .../spanner/transports/grpc_asyncio.py | 83 ++-- .../services/spanner/transports/rest.py | 70 ++- .../cloud/spanner_v1/types/change_stream.py | 2 +- google/cloud/spanner_v1/types/result_set.py | 18 +- google/cloud/spanner_v1/types/spanner.py | 463 +++++++++--------- google/cloud/spanner_v1/types/transaction.py | 64 ++- google/cloud/spanner_v1/types/type.py | 12 +- ...data_google.spanner.admin.database.v1.json | 2 +- ...data_google.spanner.admin.instance.v1.json | 2 +- .../snippet_metadata_google.spanner.v1.json | 2 +- testing/constraints-3.8.txt | 7 + 28 files changed, 1401 insertions(+), 1367 deletions(-) create mode 100644 testing/constraints-3.8.txt diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py b/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py index 41dcf45c48..0e08065a7d 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/async_client.py @@ -84,10 +84,10 @@ class DatabaseAdminAsyncClient: The Cloud Spanner Database Admin API can be used to: - - create, drop, and list databases - - update the schema of pre-existing databases - - create, delete, copy and list backups for a database - - restore a database from an existing backup + - create, drop, and list databases + - update the schema of pre-existing databases + - create, delete, copy and list backups for a database + - restore a database from an existing backup """ _client: DatabaseAdminClient @@ -749,26 +749,26 @@ async def update_database( While the operation is pending: - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field is set to true. - - Cancelling the operation is best-effort. If the cancellation - succeeds, the operation metadata's - [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] - is set, the updates are reverted, and the operation - terminates with a ``CANCELLED`` status. - - New UpdateDatabase requests will return a - ``FAILED_PRECONDITION`` error until the pending operation is - done (returns successfully or with error). - - Reading the database via the API continues to give the - pre-request values. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field is set to true. + - Cancelling the operation is best-effort. If the cancellation + succeeds, the operation metadata's + [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] + is set, the updates are reverted, and the operation terminates + with a ``CANCELLED`` status. + - New UpdateDatabase requests will return a + ``FAILED_PRECONDITION`` error until the pending operation is + done (returns successfully or with error). + - Reading the database via the API continues to give the + pre-request values. Upon completion of the returned operation: - - The new values are in effect and readable via the API. - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field becomes false. + - The new values are in effect and readable via the API. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field becomes false. The returned [long-running operation][google.longrunning.Operation] will have a name of the @@ -1384,19 +1384,19 @@ async def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1531,19 +1531,19 @@ async def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2226,7 +2226,7 @@ async def sample_update_backup(): required. Other fields are ignored. Update is only supported for the following fields: - - ``backup.expire_time``. + - ``backup.expire_time``. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/client.py b/google/cloud/spanner_admin_database_v1/services/database_admin/client.py index 08211de569..5f85aa39b1 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/client.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/client.py @@ -127,10 +127,10 @@ class DatabaseAdminClient(metaclass=DatabaseAdminClientMeta): The Cloud Spanner Database Admin API can be used to: - - create, drop, and list databases - - update the schema of pre-existing databases - - create, delete, copy and list backups for a database - - restore a database from an existing backup + - create, drop, and list databases + - update the schema of pre-existing databases + - create, delete, copy and list backups for a database + - restore a database from an existing backup """ @staticmethod @@ -1297,26 +1297,26 @@ def update_database( While the operation is pending: - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field is set to true. - - Cancelling the operation is best-effort. If the cancellation - succeeds, the operation metadata's - [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] - is set, the updates are reverted, and the operation - terminates with a ``CANCELLED`` status. - - New UpdateDatabase requests will return a - ``FAILED_PRECONDITION`` error until the pending operation is - done (returns successfully or with error). - - Reading the database via the API continues to give the - pre-request values. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field is set to true. + - Cancelling the operation is best-effort. If the cancellation + succeeds, the operation metadata's + [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] + is set, the updates are reverted, and the operation terminates + with a ``CANCELLED`` status. + - New UpdateDatabase requests will return a + ``FAILED_PRECONDITION`` error until the pending operation is + done (returns successfully or with error). + - Reading the database via the API continues to give the + pre-request values. Upon completion of the returned operation: - - The new values are in effect and readable via the API. - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field becomes false. + - The new values are in effect and readable via the API. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field becomes false. The returned [long-running operation][google.longrunning.Operation] will have a name of the @@ -1920,19 +1920,19 @@ def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2068,19 +2068,19 @@ def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2756,7 +2756,7 @@ def sample_update_backup(): required. Other fields are ignored. Update is only supported for the following fields: - - ``backup.expire_time``. + - ``backup.expire_time``. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py index 7d6ce40830..8f31a1fb98 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc.py @@ -126,10 +126,10 @@ class DatabaseAdminGrpcTransport(DatabaseAdminTransport): The Cloud Spanner Database Admin API can be used to: - - create, drop, and list databases - - update the schema of pre-existing databases - - create, delete, copy and list backups for a database - - restore a database from an existing backup + - create, drop, and list databases + - update the schema of pre-existing databases + - create, delete, copy and list backups for a database + - restore a database from an existing backup This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -464,26 +464,26 @@ def update_database( While the operation is pending: - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field is set to true. - - Cancelling the operation is best-effort. If the cancellation - succeeds, the operation metadata's - [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] - is set, the updates are reverted, and the operation - terminates with a ``CANCELLED`` status. - - New UpdateDatabase requests will return a - ``FAILED_PRECONDITION`` error until the pending operation is - done (returns successfully or with error). - - Reading the database via the API continues to give the - pre-request values. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field is set to true. + - Cancelling the operation is best-effort. If the cancellation + succeeds, the operation metadata's + [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] + is set, the updates are reverted, and the operation terminates + with a ``CANCELLED`` status. + - New UpdateDatabase requests will return a + ``FAILED_PRECONDITION`` error until the pending operation is + done (returns successfully or with error). + - Reading the database via the API continues to give the + pre-request values. Upon completion of the returned operation: - - The new values are in effect and readable via the API. - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field becomes false. + - The new values are in effect and readable via the API. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field becomes false. The returned [long-running operation][google.longrunning.Operation] will have a name of the diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py index 72eb10b7b3..5171d84d40 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/grpc_asyncio.py @@ -132,10 +132,10 @@ class DatabaseAdminGrpcAsyncIOTransport(DatabaseAdminTransport): The Cloud Spanner Database Admin API can be used to: - - create, drop, and list databases - - update the schema of pre-existing databases - - create, delete, copy and list backups for a database - - restore a database from an existing backup + - create, drop, and list databases + - update the schema of pre-existing databases + - create, delete, copy and list backups for a database + - restore a database from an existing backup This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -475,26 +475,26 @@ def update_database( While the operation is pending: - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field is set to true. - - Cancelling the operation is best-effort. If the cancellation - succeeds, the operation metadata's - [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] - is set, the updates are reverted, and the operation - terminates with a ``CANCELLED`` status. - - New UpdateDatabase requests will return a - ``FAILED_PRECONDITION`` error until the pending operation is - done (returns successfully or with error). - - Reading the database via the API continues to give the - pre-request values. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field is set to true. + - Cancelling the operation is best-effort. If the cancellation + succeeds, the operation metadata's + [cancel_time][google.spanner.admin.database.v1.UpdateDatabaseMetadata.cancel_time] + is set, the updates are reverted, and the operation terminates + with a ``CANCELLED`` status. + - New UpdateDatabase requests will return a + ``FAILED_PRECONDITION`` error until the pending operation is + done (returns successfully or with error). + - Reading the database via the API continues to give the + pre-request values. Upon completion of the returned operation: - - The new values are in effect and readable via the API. - - The database's - [reconciling][google.spanner.admin.database.v1.Database.reconciling] - field becomes false. + - The new values are in effect and readable via the API. + - The database's + [reconciling][google.spanner.admin.database.v1.Database.reconciling] + field becomes false. The returned [long-running operation][google.longrunning.Operation] will have a name of the diff --git a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py index c144266a1e..df70fc5636 100644 --- a/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py +++ b/google/cloud/spanner_admin_database_v1/services/database_admin/transports/rest.py @@ -1584,10 +1584,10 @@ class DatabaseAdminRestTransport(_BaseDatabaseAdminRestTransport): The Cloud Spanner Database Admin API can be used to: - - create, drop, and list databases - - update the schema of pre-existing databases - - create, delete, copy and list backups for a database - - restore a database from an existing backup + - create, drop, and list databases + - update the schema of pre-existing databases + - create, delete, copy and list backups for a database + - restore a database from an existing backup This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation diff --git a/google/cloud/spanner_admin_database_v1/types/backup.py b/google/cloud/spanner_admin_database_v1/types/backup.py index 15e1e2836c..da236fb4ff 100644 --- a/google/cloud/spanner_admin_database_v1/types/backup.py +++ b/google/cloud/spanner_admin_database_v1/types/backup.py @@ -540,7 +540,7 @@ class UpdateBackupRequest(proto.Message): required. Other fields are ignored. Update is only supported for the following fields: - - ``backup.expire_time``. + - ``backup.expire_time``. update_mask (google.protobuf.field_mask_pb2.FieldMask): Required. A mask specifying which fields (e.g. ``expire_time``) in the Backup resource should be updated. @@ -617,17 +617,17 @@ class ListBackupsRequest(proto.Message): [Backup][google.spanner.admin.database.v1.Backup] are eligible for filtering: - - ``name`` - - ``database`` - - ``state`` - - ``create_time`` (and values are of the format - YYYY-MM-DDTHH:MM:SSZ) - - ``expire_time`` (and values are of the format - YYYY-MM-DDTHH:MM:SSZ) - - ``version_time`` (and values are of the format - YYYY-MM-DDTHH:MM:SSZ) - - ``size_bytes`` - - ``backup_schedules`` + - ``name`` + - ``database`` + - ``state`` + - ``create_time`` (and values are of the format + YYYY-MM-DDTHH:MM:SSZ) + - ``expire_time`` (and values are of the format + YYYY-MM-DDTHH:MM:SSZ) + - ``version_time`` (and values are of the format + YYYY-MM-DDTHH:MM:SSZ) + - ``size_bytes`` + - ``backup_schedules`` You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are @@ -636,23 +636,23 @@ class ListBackupsRequest(proto.Message): Here are a few examples: - - ``name:Howl`` - The backup's name contains the string - "howl". - - ``database:prod`` - The database's name contains the - string "prod". - - ``state:CREATING`` - The backup is pending creation. - - ``state:READY`` - The backup is fully created and ready - for use. - - ``(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`` - - The backup name contains the string "howl" and - ``create_time`` of the backup is before - 2018-03-28T14:50:00Z. - - ``expire_time < \"2018-03-28T14:50:00Z\"`` - The backup - ``expire_time`` is before 2018-03-28T14:50:00Z. - - ``size_bytes > 10000000000`` - The backup's size is - greater than 10GB - - ``backup_schedules:daily`` - The backup is created from a - schedule with "daily" in its name. + - ``name:Howl`` - The backup's name contains the string + "howl". + - ``database:prod`` - The database's name contains the + string "prod". + - ``state:CREATING`` - The backup is pending creation. + - ``state:READY`` - The backup is fully created and ready + for use. + - ``(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")`` + - The backup name contains the string "howl" and + ``create_time`` of the backup is before + 2018-03-28T14:50:00Z. + - ``expire_time < \"2018-03-28T14:50:00Z\"`` - The backup + ``expire_time`` is before 2018-03-28T14:50:00Z. + - ``size_bytes > 10000000000`` - The backup's size is + greater than 10GB + - ``backup_schedules:daily`` - The backup is created from a + schedule with "daily" in its name. page_size (int): Number of backups to be returned in the response. If 0 or less, defaults to the server's @@ -736,21 +736,21 @@ class ListBackupOperationsRequest(proto.Message): [operation][google.longrunning.Operation] are eligible for filtering: - - ``name`` - The name of the long-running operation - - ``done`` - False if the operation is in progress, else - true. - - ``metadata.@type`` - the type of metadata. For example, - the type string for - [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] - is - ``type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata``. - - ``metadata.`` - any field in metadata.value. - ``metadata.@type`` must be specified first if filtering - on metadata fields. - - ``error`` - Error associated with the long-running - operation. - - ``response.@type`` - the type of response. - - ``response.`` - any field in response.value. + - ``name`` - The name of the long-running operation + - ``done`` - False if the operation is in progress, else + true. + - ``metadata.@type`` - the type of metadata. For example, + the type string for + [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + is + ``type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata``. + - ``metadata.`` - any field in metadata.value. + ``metadata.@type`` must be specified first if filtering on + metadata fields. + - ``error`` - Error associated with the long-running + operation. + - ``response.@type`` - the type of response. + - ``response.`` - any field in response.value. You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are @@ -759,55 +759,55 @@ class ListBackupOperationsRequest(proto.Message): Here are a few examples: - - ``done:true`` - The operation is complete. - - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`` - ``metadata.database:prod`` - Returns operations where: - - - The operation's metadata type is - [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - - The source database name of backup contains the string - "prod". - - - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`` - ``(metadata.name:howl) AND`` - ``(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`` - ``(error:*)`` - Returns operations where: - - - The operation's metadata type is - [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. - - The backup name contains the string "howl". - - The operation started before 2018-03-28T14:50:00Z. - - The operation resulted in an error. - - - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND`` - ``(metadata.source_backup:test) AND`` - ``(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND`` - ``(error:*)`` - Returns operations where: - - - The operation's metadata type is - [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. - - The source backup name contains the string "test". - - The operation started before 2022-01-18T14:50:00Z. - - The operation resulted in an error. - - - ``((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`` - ``(metadata.database:test_db)) OR`` - ``((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND`` - ``(metadata.source_backup:test_bkp)) AND`` - ``(error:*)`` - Returns operations where: - - - The operation's metadata matches either of criteria: - - - The operation's metadata type is - [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] - AND the source database name of the backup contains - the string "test_db" - - The operation's metadata type is - [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] - AND the source backup name contains the string - "test_bkp" - - - The operation resulted in an error. + - ``done:true`` - The operation is complete. + - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`` + ``metadata.database:prod`` - Returns operations where: + + - The operation's metadata type is + [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + - The source database name of backup contains the string + "prod". + + - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`` + ``(metadata.name:howl) AND`` + ``(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`` + ``(error:*)`` - Returns operations where: + + - The operation's metadata type is + [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. + - The backup name contains the string "howl". + - The operation started before 2018-03-28T14:50:00Z. + - The operation resulted in an error. + + - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND`` + ``(metadata.source_backup:test) AND`` + ``(metadata.progress.start_time < \"2022-01-18T14:50:00Z\") AND`` + ``(error:*)`` - Returns operations where: + + - The operation's metadata type is + [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata]. + - The source backup name contains the string "test". + - The operation started before 2022-01-18T14:50:00Z. + - The operation resulted in an error. + + - ``((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CreateBackupMetadata) AND`` + ``(metadata.database:test_db)) OR`` + ``((metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.CopyBackupMetadata) AND`` + ``(metadata.source_backup:test_bkp)) AND`` + ``(error:*)`` - Returns operations where: + + - The operation's metadata matches either of criteria: + + - The operation's metadata type is + [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata] + AND the source database name of the backup contains + the string "test_db" + - The operation's metadata type is + [CopyBackupMetadata][google.spanner.admin.database.v1.CopyBackupMetadata] + AND the source backup name contains the string + "test_bkp" + + - The operation resulted in an error. page_size (int): Number of operations to be returned in the response. If 0 or less, defaults to the server's @@ -940,17 +940,16 @@ class CreateBackupEncryptionConfig(proto.Message): regions of the backup's instance configuration. Some examples: - - For single region instance configs, specify a single - regional location KMS key. - - For multi-regional instance configs of type - GOOGLE_MANAGED, either specify a multi-regional location - KMS key or multiple regional location KMS keys that cover - all regions in the instance config. - - For an instance config of type USER_MANAGED, please - specify only regional location KMS keys to cover each - region in the instance config. Multi-regional location - KMS keys are not supported for USER_MANAGED instance - configs. + - For single region instance configs, specify a single + regional location KMS key. + - For multi-regional instance configs of type + GOOGLE_MANAGED, either specify a multi-regional location + KMS key or multiple regional location KMS keys that cover + all regions in the instance config. + - For an instance config of type USER_MANAGED, please + specify only regional location KMS keys to cover each + region in the instance config. Multi-regional location KMS + keys are not supported for USER_MANAGED instance configs. """ class EncryptionType(proto.Enum): @@ -1014,17 +1013,16 @@ class CopyBackupEncryptionConfig(proto.Message): regions of the backup's instance configuration. Some examples: - - For single region instance configs, specify a single - regional location KMS key. - - For multi-regional instance configs of type - GOOGLE_MANAGED, either specify a multi-regional location - KMS key or multiple regional location KMS keys that cover - all regions in the instance config. - - For an instance config of type USER_MANAGED, please - specify only regional location KMS keys to cover each - region in the instance config. Multi-regional location - KMS keys are not supported for USER_MANAGED instance - configs. + - For single region instance configs, specify a single + regional location KMS key. + - For multi-regional instance configs of type + GOOGLE_MANAGED, either specify a multi-regional location + KMS key or multiple regional location KMS keys that cover + all regions in the instance config. + - For an instance config of type USER_MANAGED, please + specify only regional location KMS keys to cover each + region in the instance config. Multi-regional location KMS + keys are not supported for USER_MANAGED instance configs. """ class EncryptionType(proto.Enum): diff --git a/google/cloud/spanner_admin_database_v1/types/backup_schedule.py b/google/cloud/spanner_admin_database_v1/types/backup_schedule.py index 130c6879a3..2773c1ef63 100644 --- a/google/cloud/spanner_admin_database_v1/types/backup_schedule.py +++ b/google/cloud/spanner_admin_database_v1/types/backup_schedule.py @@ -167,15 +167,15 @@ class CrontabSpec(proto.Message): hour, 1 day, 1 week and 1 month. Examples of valid cron specifications: - - ``0 2/12 * * *`` : every 12 hours at (2, 14) hours past - midnight in UTC. - - ``0 2,14 * * *`` : every 12 hours at (2,14) hours past - midnight in UTC. - - ``0 2 * * *`` : once a day at 2 past midnight in UTC. - - ``0 2 * * 0`` : once a week every Sunday at 2 past - midnight in UTC. - - ``0 2 8 * *`` : once a month on 8th day at 2 past - midnight in UTC. + - ``0 2/12 * * *`` : every 12 hours at (2, 14) hours past + midnight in UTC. + - ``0 2,14 * * *`` : every 12 hours at (2,14) hours past + midnight in UTC. + - ``0 2 * * *`` : once a day at 2 past midnight in UTC. + - ``0 2 * * 0`` : once a week every Sunday at 2 past + midnight in UTC. + - ``0 2 8 * *`` : once a month on 8th day at 2 past midnight + in UTC. time_zone (str): Output only. The time zone of the times in ``CrontabSpec.text``. Currently only UTC is supported. diff --git a/google/cloud/spanner_admin_database_v1/types/common.py b/google/cloud/spanner_admin_database_v1/types/common.py index 3b78c4b153..fff1a8756c 100644 --- a/google/cloud/spanner_admin_database_v1/types/common.py +++ b/google/cloud/spanner_admin_database_v1/types/common.py @@ -99,17 +99,17 @@ class EncryptionConfig(proto.Message): regions of the database instance configuration. Some examples: - - For single region database instance configs, specify a - single regional location KMS key. - - For multi-regional database instance configs of type - GOOGLE_MANAGED, either specify a multi-regional location - KMS key or multiple regional location KMS keys that cover - all regions in the instance config. - - For a database instance config of type USER_MANAGED, - please specify only regional location KMS keys to cover - each region in the instance config. Multi-regional - location KMS keys are not supported for USER_MANAGED - instance configs. + - For single region database instance configs, specify a + single regional location KMS key. + - For multi-regional database instance configs of type + GOOGLE_MANAGED, either specify a multi-regional location + KMS key or multiple regional location KMS keys that cover + all regions in the instance config. + - For a database instance config of type USER_MANAGED, + please specify only regional location KMS keys to cover + each region in the instance config. Multi-regional + location KMS keys are not supported for USER_MANAGED + instance configs. """ kms_key_name: str = proto.Field( diff --git a/google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py b/google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py index 4f60bfc0b9..c82fdc87df 100644 --- a/google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py +++ b/google/cloud/spanner_admin_database_v1/types/spanner_database_admin.py @@ -786,21 +786,21 @@ class ListDatabaseOperationsRequest(proto.Message): [Operation][google.longrunning.Operation] are eligible for filtering: - - ``name`` - The name of the long-running operation - - ``done`` - False if the operation is in progress, else - true. - - ``metadata.@type`` - the type of metadata. For example, - the type string for - [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] - is - ``type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata``. - - ``metadata.`` - any field in metadata.value. - ``metadata.@type`` must be specified first, if filtering - on metadata fields. - - ``error`` - Error associated with the long-running - operation. - - ``response.@type`` - the type of response. - - ``response.`` - any field in response.value. + - ``name`` - The name of the long-running operation + - ``done`` - False if the operation is in progress, else + true. + - ``metadata.@type`` - the type of metadata. For example, + the type string for + [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata] + is + ``type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata``. + - ``metadata.`` - any field in metadata.value. + ``metadata.@type`` must be specified first, if filtering + on metadata fields. + - ``error`` - Error associated with the long-running + operation. + - ``response.@type`` - the type of response. + - ``response.`` - any field in response.value. You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are @@ -809,21 +809,21 @@ class ListDatabaseOperationsRequest(proto.Message): Here are a few examples: - - ``done:true`` - The operation is complete. - - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND`` - ``(metadata.source_type:BACKUP) AND`` - ``(metadata.backup_info.backup:backup_howl) AND`` - ``(metadata.name:restored_howl) AND`` - ``(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`` - ``(error:*)`` - Return operations where: - - - The operation's metadata type is - [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. - - The database is restored from a backup. - - 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. + - ``done:true`` - The operation is complete. + - ``(metadata.@type=type.googleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata) AND`` + ``(metadata.source_type:BACKUP) AND`` + ``(metadata.backup_info.backup:backup_howl) AND`` + ``(metadata.name:restored_howl) AND`` + ``(metadata.progress.start_time < \"2018-03-28T14:50:00Z\") AND`` + ``(error:*)`` - Return operations where: + + - The operation's metadata type is + [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata]. + - The database is restored from a backup. + - 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): Number of operations to be returned in the response. If 0 or less, defaults to the server's @@ -967,17 +967,17 @@ class RestoreDatabaseEncryptionConfig(proto.Message): regions of the database instance configuration. Some examples: - - For single region database instance configs, specify a - single regional location KMS key. - - For multi-regional database instance configs of type - GOOGLE_MANAGED, either specify a multi-regional location - KMS key or multiple regional location KMS keys that cover - all regions in the instance config. - - For a database instance config of type USER_MANAGED, - please specify only regional location KMS keys to cover - each region in the instance config. Multi-regional - location KMS keys are not supported for USER_MANAGED - instance configs. + - For single region database instance configs, specify a + single regional location KMS key. + - For multi-regional database instance configs of type + GOOGLE_MANAGED, either specify a multi-regional location + KMS key or multiple regional location KMS keys that cover + all regions in the instance config. + - For a database instance config of type USER_MANAGED, + please specify only regional location KMS keys to cover + each region in the instance config. Multi-regional + location KMS keys are not supported for USER_MANAGED + instance configs. """ class EncryptionType(proto.Enum): diff --git a/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py b/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py index 549946f98c..1e87fc5a63 100644 --- a/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py +++ b/google/cloud/spanner_admin_instance_v1/services/instance_admin/async_client.py @@ -598,24 +598,24 @@ async def create_instance_config( Immediately after the request returns: - - The instance configuration is readable via the API, with all - requested attributes. The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. Its state is ``CREATING``. + - The instance configuration is readable via the API, with all + requested attributes. The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. Its state is ``CREATING``. While the operation is pending: - - Cancelling the operation renders the instance configuration - immediately unreadable via the API. - - Except for deleting the creating resource, all other attempts - to modify the instance configuration are rejected. + - Cancelling the operation renders the instance configuration + immediately unreadable via the API. + - Except for deleting the creating resource, all other attempts + to modify the instance configuration are rejected. Upon completion of the returned operation: - - Instances can be created using the instance configuration. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. Its state becomes ``READY``. + - Instances can be created using the instance configuration. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. Its state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and @@ -794,31 +794,30 @@ async def update_instance_config( Immediately after the request returns: - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. While the operation is pending: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - The operation is guaranteed to succeed at undoing all - changes, after which point it terminates with a ``CANCELLED`` - status. - - All other attempts to modify the instance configuration are - rejected. - - Reading the instance configuration via the API continues to - give the pre-request values. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + The operation is guaranteed to succeed at undoing all changes, + after which point it terminates with a ``CANCELLED`` status. + - All other attempts to modify the instance configuration are + rejected. + - Reading the instance configuration via the API continues to + give the pre-request values. Upon completion of the returned operation: - - Creating instances using the instance configuration uses the - new values. - - The new values of the instance configuration are readable via - the API. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. + - Creating instances using the instance configuration uses the + new values. + - The new values of the instance configuration are readable via + the API. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. The returned long-running operation will have a name of the format ``/operations/`` and @@ -1621,25 +1620,25 @@ async def create_instance( Immediately upon completion of this request: - - The instance is readable via the API, with all requested - attributes but no allocated resources. Its state is - ``CREATING``. + - The instance is readable via the API, with all requested + attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance immediately - unreadable via the API. - - The instance can be deleted. - - All other attempts to modify the instance are rejected. + - Cancelling the operation renders the instance immediately + unreadable via the API. + - The instance can be deleted. + - All other attempts to modify the instance are rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can be created in the instance. - - The instance's allocated resource levels are readable via the - API. - - The instance's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can be created in the instance. + - The instance's allocated resource levels are readable via the + API. + - The instance's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -1812,29 +1811,29 @@ async def update_instance( Immediately upon completion of this request: - - For resource types for which a decrease in the instance's - allocation has been requested, billing is based on the - newly-requested level. + - For resource types for which a decrease in the instance's + allocation has been requested, billing is based on the + newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance are rejected. - - Reading the instance via the API continues to give the - pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance are rejected. + - Reading the instance via the API continues to give the + pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance's tables. - - The instance's new resource levels are readable via the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance's tables. + - The instance's new resource levels are readable via the API. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -2004,13 +2003,13 @@ async def delete_instance( Immediately upon completion of the request: - - Billing ceases for all of the instance's reserved resources. + - Billing ceases for all of the instance's reserved resources. Soon afterward: - - The instance and *all of its databases* immediately and - irrevocably disappear from the API. All data in the databases - is permanently deleted. + - The instance and *all of its databases* immediately and + irrevocably disappear from the API. All data in the databases + is permanently deleted. .. code-block:: python @@ -2182,19 +2181,19 @@ async def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2325,19 +2324,19 @@ async def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2651,26 +2650,26 @@ async def create_instance_partition( Immediately upon completion of this request: - - The instance partition is readable via the API, with all - requested attributes but no allocated resources. Its state is - ``CREATING``. + - The instance partition is readable via the API, with all + requested attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance partition - immediately unreadable via the API. - - The instance partition can be deleted. - - All other attempts to modify the instance partition are - rejected. + - Cancelling the operation renders the instance partition + immediately unreadable via the API. + - The instance partition can be deleted. + - All other attempts to modify the instance partition are + rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can start using this instance partition. - - The instance partition's allocated resource levels are - readable via the API. - - The instance partition's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can start using this instance partition. + - The instance partition's allocated resource levels are + readable via the API. + - The instance partition's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` @@ -2958,31 +2957,31 @@ async def update_instance_partition( Immediately upon completion of this request: - - For resource types for which a decrease in the instance - partition's allocation has been requested, billing is based - on the newly-requested level. + - For resource types for which a decrease in the instance + partition's allocation has been requested, billing is based on + the newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance partition are - rejected. - - Reading the instance partition via the API continues to give - the pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance partition are + rejected. + - Reading the instance partition via the API continues to give + the pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance partition's tables. - - The instance partition's new resource levels are readable via - the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance partition's tables. + - The instance partition's new resource levels are readable via + the API. The returned long-running operation will have a name of the format ``/operations/`` @@ -3302,33 +3301,33 @@ async def move_instance( ``MoveInstance`` returns ``FAILED_PRECONDITION`` if the instance meets any of the following criteria: - - Is undergoing a move to a different instance configuration - - Has backups - - Has an ongoing update - - Contains any CMEK-enabled databases - - Is a free trial instance + - Is undergoing a move to a different instance configuration + - Has backups + - Has an ongoing update + - Contains any CMEK-enabled databases + - Is a free trial instance While the operation is pending: - - All other attempts to modify the instance, including changes - to its compute capacity, are rejected. + - All other attempts to modify the instance, including changes + to its compute capacity, are rejected. - - The following database and backup admin operations are - rejected: + - The following database and backup admin operations are + rejected: - - ``DatabaseAdmin.CreateDatabase`` - - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if - default_leader is specified in the request.) - - ``DatabaseAdmin.RestoreDatabase`` - - ``DatabaseAdmin.CreateBackup`` - - ``DatabaseAdmin.CopyBackup`` + - ``DatabaseAdmin.CreateDatabase`` + - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if + default_leader is specified in the request.) + - ``DatabaseAdmin.RestoreDatabase`` + - ``DatabaseAdmin.CreateBackup`` + - ``DatabaseAdmin.CopyBackup`` - - Both the source and target instance configurations are - subject to hourly compute and storage charges. + - Both the source and target instance configurations are subject + to hourly compute and storage charges. - - The instance might experience higher read-write latencies and - a higher transaction abort rate. However, moving an instance - doesn't cause any downtime. + - The instance might experience higher read-write latencies and + a higher transaction abort rate. However, moving an instance + doesn't cause any downtime. The returned long-running operation has a name of the format ``/operations/`` and can be used to @@ -3347,10 +3346,10 @@ async def move_instance( If not cancelled, upon completion of the returned operation: - - The instance successfully moves to the target instance - configuration. - - You are billed for compute and storage in target instance - configuration. + - The instance successfully moves to the target instance + configuration. + - You are billed for compute and storage in target instance + configuration. Authorization requires the ``spanner.instances.update`` permission on the resource diff --git a/google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py b/google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py index ef34b5361b..c0fe398c3a 100644 --- a/google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py +++ b/google/cloud/spanner_admin_instance_v1/services/instance_admin/client.py @@ -1041,24 +1041,24 @@ def create_instance_config( Immediately after the request returns: - - The instance configuration is readable via the API, with all - requested attributes. The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. Its state is ``CREATING``. + - The instance configuration is readable via the API, with all + requested attributes. The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. Its state is ``CREATING``. While the operation is pending: - - Cancelling the operation renders the instance configuration - immediately unreadable via the API. - - Except for deleting the creating resource, all other attempts - to modify the instance configuration are rejected. + - Cancelling the operation renders the instance configuration + immediately unreadable via the API. + - Except for deleting the creating resource, all other attempts + to modify the instance configuration are rejected. Upon completion of the returned operation: - - Instances can be created using the instance configuration. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. Its state becomes ``READY``. + - Instances can be created using the instance configuration. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. Its state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and @@ -1234,31 +1234,30 @@ def update_instance_config( Immediately after the request returns: - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. While the operation is pending: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - The operation is guaranteed to succeed at undoing all - changes, after which point it terminates with a ``CANCELLED`` - status. - - All other attempts to modify the instance configuration are - rejected. - - Reading the instance configuration via the API continues to - give the pre-request values. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + The operation is guaranteed to succeed at undoing all changes, + after which point it terminates with a ``CANCELLED`` status. + - All other attempts to modify the instance configuration are + rejected. + - Reading the instance configuration via the API continues to + give the pre-request values. Upon completion of the returned operation: - - Creating instances using the instance configuration uses the - new values. - - The new values of the instance configuration are readable via - the API. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. + - Creating instances using the instance configuration uses the + new values. + - The new values of the instance configuration are readable via + the API. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. The returned long-running operation will have a name of the format ``/operations/`` and @@ -2045,25 +2044,25 @@ def create_instance( Immediately upon completion of this request: - - The instance is readable via the API, with all requested - attributes but no allocated resources. Its state is - ``CREATING``. + - The instance is readable via the API, with all requested + attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance immediately - unreadable via the API. - - The instance can be deleted. - - All other attempts to modify the instance are rejected. + - Cancelling the operation renders the instance immediately + unreadable via the API. + - The instance can be deleted. + - All other attempts to modify the instance are rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can be created in the instance. - - The instance's allocated resource levels are readable via the - API. - - The instance's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can be created in the instance. + - The instance's allocated resource levels are readable via the + API. + - The instance's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -2233,29 +2232,29 @@ def update_instance( Immediately upon completion of this request: - - For resource types for which a decrease in the instance's - allocation has been requested, billing is based on the - newly-requested level. + - For resource types for which a decrease in the instance's + allocation has been requested, billing is based on the + newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance are rejected. - - Reading the instance via the API continues to give the - pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance are rejected. + - Reading the instance via the API continues to give the + pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance's tables. - - The instance's new resource levels are readable via the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance's tables. + - The instance's new resource levels are readable via the API. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -2422,13 +2421,13 @@ def delete_instance( Immediately upon completion of the request: - - Billing ceases for all of the instance's reserved resources. + - Billing ceases for all of the instance's reserved resources. Soon afterward: - - The instance and *all of its databases* immediately and - irrevocably disappear from the API. All data in the databases - is permanently deleted. + - The instance and *all of its databases* immediately and + irrevocably disappear from the API. All data in the databases + is permanently deleted. .. code-block:: python @@ -2597,19 +2596,19 @@ def sample_set_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -2741,19 +2740,19 @@ def sample_get_iam_policy(): constraints based on attributes of the request, the resource, or both. To learn which resources support conditions in their IAM policies, see the [IAM - documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + documentation](https://cloud.google.com/iam/help/conditions/resource-policies). **JSON example:** - :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` + :literal:`` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \` **YAML example:** - :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` + :literal:`` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \` For a description of IAM and its features, see the [IAM - documentation](\ https://cloud.google.com/iam/docs/). + documentation](https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -3066,26 +3065,26 @@ def create_instance_partition( Immediately upon completion of this request: - - The instance partition is readable via the API, with all - requested attributes but no allocated resources. Its state is - ``CREATING``. + - The instance partition is readable via the API, with all + requested attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance partition - immediately unreadable via the API. - - The instance partition can be deleted. - - All other attempts to modify the instance partition are - rejected. + - Cancelling the operation renders the instance partition + immediately unreadable via the API. + - The instance partition can be deleted. + - All other attempts to modify the instance partition are + rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can start using this instance partition. - - The instance partition's allocated resource levels are - readable via the API. - - The instance partition's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can start using this instance partition. + - The instance partition's allocated resource levels are + readable via the API. + - The instance partition's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` @@ -3371,31 +3370,31 @@ def update_instance_partition( Immediately upon completion of this request: - - For resource types for which a decrease in the instance - partition's allocation has been requested, billing is based - on the newly-requested level. + - For resource types for which a decrease in the instance + partition's allocation has been requested, billing is based on + the newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance partition are - rejected. - - Reading the instance partition via the API continues to give - the pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance partition are + rejected. + - Reading the instance partition via the API continues to give + the pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance partition's tables. - - The instance partition's new resource levels are readable via - the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance partition's tables. + - The instance partition's new resource levels are readable via + the API. The returned long-running operation will have a name of the format ``/operations/`` @@ -3713,33 +3712,33 @@ def move_instance( ``MoveInstance`` returns ``FAILED_PRECONDITION`` if the instance meets any of the following criteria: - - Is undergoing a move to a different instance configuration - - Has backups - - Has an ongoing update - - Contains any CMEK-enabled databases - - Is a free trial instance + - Is undergoing a move to a different instance configuration + - Has backups + - Has an ongoing update + - Contains any CMEK-enabled databases + - Is a free trial instance While the operation is pending: - - All other attempts to modify the instance, including changes - to its compute capacity, are rejected. + - All other attempts to modify the instance, including changes + to its compute capacity, are rejected. - - The following database and backup admin operations are - rejected: + - The following database and backup admin operations are + rejected: - - ``DatabaseAdmin.CreateDatabase`` - - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if - default_leader is specified in the request.) - - ``DatabaseAdmin.RestoreDatabase`` - - ``DatabaseAdmin.CreateBackup`` - - ``DatabaseAdmin.CopyBackup`` + - ``DatabaseAdmin.CreateDatabase`` + - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if + default_leader is specified in the request.) + - ``DatabaseAdmin.RestoreDatabase`` + - ``DatabaseAdmin.CreateBackup`` + - ``DatabaseAdmin.CopyBackup`` - - Both the source and target instance configurations are - subject to hourly compute and storage charges. + - Both the source and target instance configurations are subject + to hourly compute and storage charges. - - The instance might experience higher read-write latencies and - a higher transaction abort rate. However, moving an instance - doesn't cause any downtime. + - The instance might experience higher read-write latencies and + a higher transaction abort rate. However, moving an instance + doesn't cause any downtime. The returned long-running operation has a name of the format ``/operations/`` and can be used to @@ -3758,10 +3757,10 @@ def move_instance( If not cancelled, upon completion of the returned operation: - - The instance successfully moves to the target instance - configuration. - - You are billed for compute and storage in target instance - configuration. + - The instance successfully moves to the target instance + configuration. + - You are billed for compute and storage in target instance + configuration. Authorization requires the ``spanner.instances.update`` permission on the resource diff --git a/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py b/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py index 9066da9b07..ee5b765210 100644 --- a/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py +++ b/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc.py @@ -443,24 +443,24 @@ def create_instance_config( Immediately after the request returns: - - The instance configuration is readable via the API, with all - requested attributes. The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. Its state is ``CREATING``. + - The instance configuration is readable via the API, with all + requested attributes. The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. Its state is ``CREATING``. While the operation is pending: - - Cancelling the operation renders the instance configuration - immediately unreadable via the API. - - Except for deleting the creating resource, all other attempts - to modify the instance configuration are rejected. + - Cancelling the operation renders the instance configuration + immediately unreadable via the API. + - Except for deleting the creating resource, all other attempts + to modify the instance configuration are rejected. Upon completion of the returned operation: - - Instances can be created using the instance configuration. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. Its state becomes ``READY``. + - Instances can be created using the instance configuration. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. Its state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and @@ -510,31 +510,30 @@ def update_instance_config( Immediately after the request returns: - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. While the operation is pending: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - The operation is guaranteed to succeed at undoing all - changes, after which point it terminates with a ``CANCELLED`` - status. - - All other attempts to modify the instance configuration are - rejected. - - Reading the instance configuration via the API continues to - give the pre-request values. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + The operation is guaranteed to succeed at undoing all changes, + after which point it terminates with a ``CANCELLED`` status. + - All other attempts to modify the instance configuration are + rejected. + - Reading the instance configuration via the API continues to + give the pre-request values. Upon completion of the returned operation: - - Creating instances using the instance configuration uses the - new values. - - The new values of the instance configuration are readable via - the API. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. + - Creating instances using the instance configuration uses the + new values. + - The new values of the instance configuration are readable via + the API. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. The returned long-running operation will have a name of the format ``/operations/`` and @@ -747,25 +746,25 @@ def create_instance( Immediately upon completion of this request: - - The instance is readable via the API, with all requested - attributes but no allocated resources. Its state is - ``CREATING``. + - The instance is readable via the API, with all requested + attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance immediately - unreadable via the API. - - The instance can be deleted. - - All other attempts to modify the instance are rejected. + - Cancelling the operation renders the instance immediately + unreadable via the API. + - The instance can be deleted. + - All other attempts to modify the instance are rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can be created in the instance. - - The instance's allocated resource levels are readable via the - API. - - The instance's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can be created in the instance. + - The instance's allocated resource levels are readable via the + API. + - The instance's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -809,29 +808,29 @@ def update_instance( Immediately upon completion of this request: - - For resource types for which a decrease in the instance's - allocation has been requested, billing is based on the - newly-requested level. + - For resource types for which a decrease in the instance's + allocation has been requested, billing is based on the + newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance are rejected. - - Reading the instance via the API continues to give the - pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance are rejected. + - Reading the instance via the API continues to give the + pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance's tables. - - The instance's new resource levels are readable via the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance's tables. + - The instance's new resource levels are readable via the API. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -874,13 +873,13 @@ def delete_instance( Immediately upon completion of the request: - - Billing ceases for all of the instance's reserved resources. + - Billing ceases for all of the instance's reserved resources. Soon afterward: - - The instance and *all of its databases* immediately and - irrevocably disappear from the API. All data in the databases - is permanently deleted. + - The instance and *all of its databases* immediately and + irrevocably disappear from the API. All data in the databases + is permanently deleted. Returns: Callable[[~.DeleteInstanceRequest], @@ -1044,26 +1043,26 @@ def create_instance_partition( Immediately upon completion of this request: - - The instance partition is readable via the API, with all - requested attributes but no allocated resources. Its state is - ``CREATING``. + - The instance partition is readable via the API, with all + requested attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance partition - immediately unreadable via the API. - - The instance partition can be deleted. - - All other attempts to modify the instance partition are - rejected. + - Cancelling the operation renders the instance partition + immediately unreadable via the API. + - The instance partition can be deleted. + - All other attempts to modify the instance partition are + rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can start using this instance partition. - - The instance partition's allocated resource levels are - readable via the API. - - The instance partition's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can start using this instance partition. + - The instance partition's allocated resource levels are + readable via the API. + - The instance partition's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` @@ -1143,31 +1142,31 @@ def update_instance_partition( Immediately upon completion of this request: - - For resource types for which a decrease in the instance - partition's allocation has been requested, billing is based - on the newly-requested level. + - For resource types for which a decrease in the instance + partition's allocation has been requested, billing is based on + the newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance partition are - rejected. - - Reading the instance partition via the API continues to give - the pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance partition are + rejected. + - Reading the instance partition via the API continues to give + the pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance partition's tables. - - The instance partition's new resource levels are readable via - the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance partition's tables. + - The instance partition's new resource levels are readable via + the API. The returned long-running operation will have a name of the format ``/operations/`` @@ -1261,33 +1260,33 @@ def move_instance( ``MoveInstance`` returns ``FAILED_PRECONDITION`` if the instance meets any of the following criteria: - - Is undergoing a move to a different instance configuration - - Has backups - - Has an ongoing update - - Contains any CMEK-enabled databases - - Is a free trial instance + - Is undergoing a move to a different instance configuration + - Has backups + - Has an ongoing update + - Contains any CMEK-enabled databases + - Is a free trial instance While the operation is pending: - - All other attempts to modify the instance, including changes - to its compute capacity, are rejected. + - All other attempts to modify the instance, including changes + to its compute capacity, are rejected. - - The following database and backup admin operations are - rejected: + - The following database and backup admin operations are + rejected: - - ``DatabaseAdmin.CreateDatabase`` - - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if - default_leader is specified in the request.) - - ``DatabaseAdmin.RestoreDatabase`` - - ``DatabaseAdmin.CreateBackup`` - - ``DatabaseAdmin.CopyBackup`` + - ``DatabaseAdmin.CreateDatabase`` + - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if + default_leader is specified in the request.) + - ``DatabaseAdmin.RestoreDatabase`` + - ``DatabaseAdmin.CreateBackup`` + - ``DatabaseAdmin.CopyBackup`` - - Both the source and target instance configurations are - subject to hourly compute and storage charges. + - Both the source and target instance configurations are subject + to hourly compute and storage charges. - - The instance might experience higher read-write latencies and - a higher transaction abort rate. However, moving an instance - doesn't cause any downtime. + - The instance might experience higher read-write latencies and + a higher transaction abort rate. However, moving an instance + doesn't cause any downtime. The returned long-running operation has a name of the format ``/operations/`` and can be used to @@ -1306,10 +1305,10 @@ def move_instance( If not cancelled, upon completion of the returned operation: - - The instance successfully moves to the target instance - configuration. - - You are billed for compute and storage in target instance - configuration. + - The instance successfully moves to the target instance + configuration. + - You are billed for compute and storage in target instance + configuration. Authorization requires the ``spanner.instances.update`` permission on the resource diff --git a/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py b/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py index 04793a6bc3..f2df40d1f2 100644 --- a/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py +++ b/google/cloud/spanner_admin_instance_v1/services/instance_admin/transports/grpc_asyncio.py @@ -452,24 +452,24 @@ def create_instance_config( Immediately after the request returns: - - The instance configuration is readable via the API, with all - requested attributes. The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. Its state is ``CREATING``. + - The instance configuration is readable via the API, with all + requested attributes. The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. Its state is ``CREATING``. While the operation is pending: - - Cancelling the operation renders the instance configuration - immediately unreadable via the API. - - Except for deleting the creating resource, all other attempts - to modify the instance configuration are rejected. + - Cancelling the operation renders the instance configuration + immediately unreadable via the API. + - Except for deleting the creating resource, all other attempts + to modify the instance configuration are rejected. Upon completion of the returned operation: - - Instances can be created using the instance configuration. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. Its state becomes ``READY``. + - Instances can be created using the instance configuration. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. Its state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and @@ -520,31 +520,30 @@ def update_instance_config( Immediately after the request returns: - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field is set to true. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field is set to true. While the operation is pending: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. - The operation is guaranteed to succeed at undoing all - changes, after which point it terminates with a ``CANCELLED`` - status. - - All other attempts to modify the instance configuration are - rejected. - - Reading the instance configuration via the API continues to - give the pre-request values. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceConfigMetadata.cancel_time]. + The operation is guaranteed to succeed at undoing all changes, + after which point it terminates with a ``CANCELLED`` status. + - All other attempts to modify the instance configuration are + rejected. + - Reading the instance configuration via the API continues to + give the pre-request values. Upon completion of the returned operation: - - Creating instances using the instance configuration uses the - new values. - - The new values of the instance configuration are readable via - the API. - - The instance configuration's - [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] - field becomes false. + - Creating instances using the instance configuration uses the + new values. + - The new values of the instance configuration are readable via + the API. + - The instance configuration's + [reconciling][google.spanner.admin.instance.v1.InstanceConfig.reconciling] + field becomes false. The returned long-running operation will have a name of the format ``/operations/`` and @@ -759,25 +758,25 @@ def create_instance( Immediately upon completion of this request: - - The instance is readable via the API, with all requested - attributes but no allocated resources. Its state is - ``CREATING``. + - The instance is readable via the API, with all requested + attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance immediately - unreadable via the API. - - The instance can be deleted. - - All other attempts to modify the instance are rejected. + - Cancelling the operation renders the instance immediately + unreadable via the API. + - The instance can be deleted. + - All other attempts to modify the instance are rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can be created in the instance. - - The instance's allocated resource levels are readable via the - API. - - The instance's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can be created in the instance. + - The instance's allocated resource levels are readable via the + API. + - The instance's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -822,29 +821,29 @@ def update_instance( Immediately upon completion of this request: - - For resource types for which a decrease in the instance's - allocation has been requested, billing is based on the - newly-requested level. + - For resource types for which a decrease in the instance's + allocation has been requested, billing is based on the + newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance are rejected. - - Reading the instance via the API continues to give the - pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance are rejected. + - Reading the instance via the API continues to give the + pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance's tables. - - The instance's new resource levels are readable via the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance's tables. + - The instance's new resource levels are readable via the API. The returned long-running operation will have a name of the format ``/operations/`` and can be @@ -889,13 +888,13 @@ def delete_instance( Immediately upon completion of the request: - - Billing ceases for all of the instance's reserved resources. + - Billing ceases for all of the instance's reserved resources. Soon afterward: - - The instance and *all of its databases* immediately and - irrevocably disappear from the API. All data in the databases - is permanently deleted. + - The instance and *all of its databases* immediately and + irrevocably disappear from the API. All data in the databases + is permanently deleted. Returns: Callable[[~.DeleteInstanceRequest], @@ -1059,26 +1058,26 @@ def create_instance_partition( Immediately upon completion of this request: - - The instance partition is readable via the API, with all - requested attributes but no allocated resources. Its state is - ``CREATING``. + - The instance partition is readable via the API, with all + requested attributes but no allocated resources. Its state is + ``CREATING``. Until completion of the returned operation: - - Cancelling the operation renders the instance partition - immediately unreadable via the API. - - The instance partition can be deleted. - - All other attempts to modify the instance partition are - rejected. + - Cancelling the operation renders the instance partition + immediately unreadable via the API. + - The instance partition can be deleted. + - All other attempts to modify the instance partition are + rejected. Upon completion of the returned operation: - - Billing for all successfully-allocated resources begins (some - types may have lower than the requested levels). - - Databases can start using this instance partition. - - The instance partition's allocated resource levels are - readable via the API. - - The instance partition's state becomes ``READY``. + - Billing for all successfully-allocated resources begins (some + types may have lower than the requested levels). + - Databases can start using this instance partition. + - The instance partition's allocated resource levels are + readable via the API. + - The instance partition's state becomes ``READY``. The returned long-running operation will have a name of the format ``/operations/`` @@ -1159,31 +1158,31 @@ def update_instance_partition( Immediately upon completion of this request: - - For resource types for which a decrease in the instance - partition's allocation has been requested, billing is based - on the newly-requested level. + - For resource types for which a decrease in the instance + partition's allocation has been requested, billing is based on + the newly-requested level. Until completion of the returned operation: - - Cancelling the operation sets its metadata's - [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], - and begins restoring resources to their pre-request values. - The operation is guaranteed to succeed at undoing all - resource changes, after which point it terminates with a - ``CANCELLED`` status. - - All other attempts to modify the instance partition are - rejected. - - Reading the instance partition via the API continues to give - the pre-request resource levels. + - Cancelling the operation sets its metadata's + [cancel_time][google.spanner.admin.instance.v1.UpdateInstancePartitionMetadata.cancel_time], + and begins restoring resources to their pre-request values. + The operation is guaranteed to succeed at undoing all resource + changes, after which point it terminates with a ``CANCELLED`` + status. + - All other attempts to modify the instance partition are + rejected. + - Reading the instance partition via the API continues to give + the pre-request resource levels. Upon completion of the returned operation: - - Billing begins for all successfully-allocated resources (some - types may have lower than the requested levels). - - All newly-reserved resources are available for serving the - instance partition's tables. - - The instance partition's new resource levels are readable via - the API. + - Billing begins for all successfully-allocated resources (some + types may have lower than the requested levels). + - All newly-reserved resources are available for serving the + instance partition's tables. + - The instance partition's new resource levels are readable via + the API. The returned long-running operation will have a name of the format ``/operations/`` @@ -1278,33 +1277,33 @@ def move_instance( ``MoveInstance`` returns ``FAILED_PRECONDITION`` if the instance meets any of the following criteria: - - Is undergoing a move to a different instance configuration - - Has backups - - Has an ongoing update - - Contains any CMEK-enabled databases - - Is a free trial instance + - Is undergoing a move to a different instance configuration + - Has backups + - Has an ongoing update + - Contains any CMEK-enabled databases + - Is a free trial instance While the operation is pending: - - All other attempts to modify the instance, including changes - to its compute capacity, are rejected. + - All other attempts to modify the instance, including changes + to its compute capacity, are rejected. - - The following database and backup admin operations are - rejected: + - The following database and backup admin operations are + rejected: - - ``DatabaseAdmin.CreateDatabase`` - - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if - default_leader is specified in the request.) - - ``DatabaseAdmin.RestoreDatabase`` - - ``DatabaseAdmin.CreateBackup`` - - ``DatabaseAdmin.CopyBackup`` + - ``DatabaseAdmin.CreateDatabase`` + - ``DatabaseAdmin.UpdateDatabaseDdl`` (disabled if + default_leader is specified in the request.) + - ``DatabaseAdmin.RestoreDatabase`` + - ``DatabaseAdmin.CreateBackup`` + - ``DatabaseAdmin.CopyBackup`` - - Both the source and target instance configurations are - subject to hourly compute and storage charges. + - Both the source and target instance configurations are subject + to hourly compute and storage charges. - - The instance might experience higher read-write latencies and - a higher transaction abort rate. However, moving an instance - doesn't cause any downtime. + - The instance might experience higher read-write latencies and + a higher transaction abort rate. However, moving an instance + doesn't cause any downtime. The returned long-running operation has a name of the format ``/operations/`` and can be used to @@ -1323,10 +1322,10 @@ def move_instance( If not cancelled, upon completion of the returned operation: - - The instance successfully moves to the target instance - configuration. - - You are billed for compute and storage in target instance - configuration. + - The instance successfully moves to the target instance + configuration. + - You are billed for compute and storage in target instance + configuration. Authorization requires the ``spanner.instances.update`` permission on the resource diff --git a/google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py b/google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py index 44dc52ddc4..1e1509d1c4 100644 --- a/google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py +++ b/google/cloud/spanner_admin_instance_v1/types/spanner_instance_admin.py @@ -99,28 +99,28 @@ class ReplicaType(proto.Enum): Read-write replicas support both reads and writes. These replicas: - - Maintain a full copy of your data. - - Serve reads. - - Can vote whether to commit a write. - - Participate in leadership election. - - Are eligible to become a leader. + - Maintain a full copy of your data. + - Serve reads. + - Can vote whether to commit a write. + - Participate in leadership election. + - Are eligible to become a leader. READ_ONLY (2): Read-only replicas only support reads (not writes). Read-only replicas: - - Maintain a full copy of your data. - - Serve reads. - - Do not participate in voting to commit writes. - - Are not eligible to become a leader. + - Maintain a full copy of your data. + - Serve reads. + - Do not participate in voting to commit writes. + - Are not eligible to become a leader. WITNESS (3): Witness replicas don't support reads but do participate in voting to commit writes. Witness replicas: - - Do not maintain a full copy of data. - - Do not serve reads. - - Vote whether to commit writes. - - Participate in leader election but are not eligible to - become leader. + - Do not maintain a full copy of data. + - Do not serve reads. + - Vote whether to commit writes. + - Participate in leader election but are not eligible to + become leader. """ TYPE_UNSPECIFIED = 0 READ_WRITE = 1 @@ -190,14 +190,14 @@ class InstanceConfig(proto.Message): management rules (e.g. route, firewall, load balancing, etc.). - - Label keys must be between 1 and 63 characters long and - must conform to the following regular expression: - ``[a-z][a-z0-9_-]{0,62}``. - - Label values must be between 0 and 63 characters long and - must conform to the regular expression - ``[a-z0-9_-]{0,63}``. - - No more than 64 labels can be associated with a given - resource. + - Label keys must be between 1 and 63 characters long and + must conform to the following regular expression: + ``[a-z][a-z0-9_-]{0,62}``. + - Label values must be between 0 and 63 characters long and + must conform to the regular expression + ``[a-z0-9_-]{0,63}``. + - No more than 64 labels can be associated with a given + resource. See https://goo.gl/xmQnxf for more information on and examples of labels. @@ -725,14 +725,14 @@ class Instance(proto.Message): management rules (e.g. route, firewall, load balancing, etc.). - - Label keys must be between 1 and 63 characters long and - must conform to the following regular expression: - ``[a-z][a-z0-9_-]{0,62}``. - - Label values must be between 0 and 63 characters long and - must conform to the regular expression - ``[a-z0-9_-]{0,63}``. - - No more than 64 labels can be associated with a given - resource. + - Label keys must be between 1 and 63 characters long and + must conform to the following regular expression: + ``[a-z][a-z0-9_-]{0,62}``. + - Label values must be between 0 and 63 characters long and + must conform to the regular expression + ``[a-z0-9_-]{0,63}``. + - No more than 64 labels can be associated with a given + resource. See https://goo.gl/xmQnxf for more information on and examples of labels. @@ -1169,21 +1169,21 @@ class ListInstanceConfigOperationsRequest(proto.Message): The following fields in the Operation are eligible for filtering: - - ``name`` - The name of the long-running operation - - ``done`` - False if the operation is in progress, else - true. - - ``metadata.@type`` - the type of metadata. For example, - the type string for - [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata] - is - ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata``. - - ``metadata.`` - any field in metadata.value. - ``metadata.@type`` must be specified first, if filtering - on metadata fields. - - ``error`` - Error associated with the long-running - operation. - - ``response.@type`` - the type of response. - - ``response.`` - any field in response.value. + - ``name`` - The name of the long-running operation + - ``done`` - False if the operation is in progress, else + true. + - ``metadata.@type`` - the type of metadata. For example, + the type string for + [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata] + is + ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata``. + - ``metadata.`` - any field in metadata.value. + ``metadata.@type`` must be specified first, if filtering + on metadata fields. + - ``error`` - Error associated with the long-running + operation. + - ``response.@type`` - the type of response. + - ``response.`` - any field in response.value. You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are @@ -1192,19 +1192,19 @@ class ListInstanceConfigOperationsRequest(proto.Message): Here are a few examples: - - ``done:true`` - The operation is complete. - - ``(metadata.@type=`` - ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) AND`` - ``(metadata.instance_config.name:custom-config) AND`` - ``(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND`` - ``(error:*)`` - Return operations where: - - - The operation's metadata type is - [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. - - The instance configuration name contains - "custom-config". - - The operation started before 2021-03-28T14:50:00Z. - - The operation resulted in an error. + - ``done:true`` - The operation is complete. + - ``(metadata.@type=`` + ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata) AND`` + ``(metadata.instance_config.name:custom-config) AND`` + ``(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND`` + ``(error:*)`` - Return operations where: + + - The operation's metadata type is + [CreateInstanceConfigMetadata][google.spanner.admin.instance.v1.CreateInstanceConfigMetadata]. + - The instance configuration name contains + "custom-config". + - The operation started before 2021-03-28T14:50:00Z. + - The operation resulted in an error. page_size (int): Number of operations to be returned in the response. If 0 or less, defaults to the server's @@ -1350,23 +1350,23 @@ class ListInstancesRequest(proto.Message): Filter rules are case insensitive. The fields eligible for filtering are: - - ``name`` - - ``display_name`` - - ``labels.key`` where key is the name of a label + - ``name`` + - ``display_name`` + - ``labels.key`` where key is the name of a label Some examples of using filters are: - - ``name:*`` --> The instance has a name. - - ``name:Howl`` --> The instance's name contains the string - "howl". - - ``name:HOWL`` --> Equivalent to above. - - ``NAME:howl`` --> Equivalent to above. - - ``labels.env:*`` --> The instance has the label "env". - - ``labels.env:dev`` --> The instance has the label "env" - and the value of the label contains the string "dev". - - ``name:howl labels.env:dev`` --> The instance's name - contains "howl" and it has the label "env" with its value - containing "dev". + - ``name:*`` --> The instance has a name. + - ``name:Howl`` --> The instance's name contains the string + "howl". + - ``name:HOWL`` --> Equivalent to above. + - ``NAME:howl`` --> Equivalent to above. + - ``labels.env:*`` --> The instance has the label "env". + - ``labels.env:dev`` --> The instance has the label "env" + and the value of the label contains the string "dev". + - ``name:howl labels.env:dev`` --> The instance's name + contains "howl" and it has the label "env" with its value + containing "dev". instance_deadline (google.protobuf.timestamp_pb2.Timestamp): Deadline used while retrieving metadata for instances. Instances whose metadata cannot be retrieved within this @@ -2185,21 +2185,21 @@ class ListInstancePartitionOperationsRequest(proto.Message): The following fields in the Operation are eligible for filtering: - - ``name`` - The name of the long-running operation - - ``done`` - False if the operation is in progress, else - true. - - ``metadata.@type`` - the type of metadata. For example, - the type string for - [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata] - is - ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata``. - - ``metadata.`` - any field in metadata.value. - ``metadata.@type`` must be specified first, if filtering - on metadata fields. - - ``error`` - Error associated with the long-running - operation. - - ``response.@type`` - the type of response. - - ``response.`` - any field in response.value. + - ``name`` - The name of the long-running operation + - ``done`` - False if the operation is in progress, else + true. + - ``metadata.@type`` - the type of metadata. For example, + the type string for + [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata] + is + ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata``. + - ``metadata.`` - any field in metadata.value. + ``metadata.@type`` must be specified first, if filtering + on metadata fields. + - ``error`` - Error associated with the long-running + operation. + - ``response.@type`` - the type of response. + - ``response.`` - any field in response.value. You can combine multiple expressions by enclosing each expression in parentheses. By default, expressions are @@ -2208,19 +2208,19 @@ class ListInstancePartitionOperationsRequest(proto.Message): Here are a few examples: - - ``done:true`` - The operation is complete. - - ``(metadata.@type=`` - ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) AND`` - ``(metadata.instance_partition.name:custom-instance-partition) AND`` - ``(metadata.start_time < \"2021-03-28T14:50:00Z\") AND`` - ``(error:*)`` - Return operations where: - - - The operation's metadata type is - [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. - - The instance partition name contains - "custom-instance-partition". - - The operation started before 2021-03-28T14:50:00Z. - - The operation resulted in an error. + - ``done:true`` - The operation is complete. + - ``(metadata.@type=`` + ``type.googleapis.com/google.spanner.admin.instance.v1.CreateInstancePartitionMetadata) AND`` + ``(metadata.instance_partition.name:custom-instance-partition) AND`` + ``(metadata.start_time < \"2021-03-28T14:50:00Z\") AND`` + ``(error:*)`` - Return operations where: + + - The operation's metadata type is + [CreateInstancePartitionMetadata][google.spanner.admin.instance.v1.CreateInstancePartitionMetadata]. + - The instance partition name contains + "custom-instance-partition". + - The operation started before 2021-03-28T14:50:00Z. + - The operation resulted in an error. page_size (int): Optional. Number of operations to be returned in the response. If 0 or less, defaults to the diff --git a/google/cloud/spanner_v1/services/spanner/async_client.py b/google/cloud/spanner_v1/services/spanner/async_client.py index fbacbddcce..c48b62d532 100644 --- a/google/cloud/spanner_v1/services/spanner/async_client.py +++ b/google/cloud/spanner_v1/services/spanner/async_client.py @@ -314,14 +314,14 @@ async def create_session( transaction internally, and count toward the one transaction limit. - Active sessions use additional server resources, so it is a good + Active sessions use additional server resources, so it's a good idea to delete idle and unneeded sessions. Aside from explicit - deletes, Cloud Spanner may delete sessions for which no - operations are sent for more than an hour. If a session is - deleted, requests to it return ``NOT_FOUND``. + deletes, Cloud Spanner can delete sessions when no operations + are sent for more than an hour. If a session is deleted, + requests to it return ``NOT_FOUND``. Idle sessions can be kept alive by sending a trivial SQL query - periodically, e.g., ``"SELECT 1"``. + periodically, for example, ``"SELECT 1"``. .. code-block:: python @@ -477,10 +477,10 @@ async def sample_batch_create_sessions(): should not be set. session_count (:class:`int`): Required. The number of sessions to be created in this - batch call. The API may return fewer than the requested + batch call. The API can 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 + ``BatchCreateSessions`` (adjusting [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). @@ -561,7 +561,7 @@ async def get_session( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> spanner.Session: - r"""Gets a session. Returns ``NOT_FOUND`` if the session does not + r"""Gets a session. Returns ``NOT_FOUND`` if the session doesn't exist. This is mainly useful for determining whether a session is still alive. @@ -799,7 +799,7 @@ async def delete_session( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Ends a session, releasing server resources associated - with it. This will asynchronously trigger cancellation + with it. This asynchronously triggers the cancellation of any operations that are running with this session. .. code-block:: python @@ -899,7 +899,7 @@ async def execute_sql( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> result_set.ResultSet: r"""Executes an SQL statement, returning all results in a single - reply. This method cannot be used to return a result set larger + reply. This method can't 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. @@ -913,6 +913,9 @@ async def execute_sql( [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + The query string can be SQL or `Graph Query Language + (GQL) `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -1006,6 +1009,9 @@ def execute_streaming_sql( individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB. + The query string can be SQL or `Graph Query Language + (GQL) `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -1179,8 +1185,8 @@ async def sample_execute_batch_dml(): Example 1: - - Request: 5 DML statements, all executed - successfully. + - Request: 5 DML statements, all executed + successfully. \* Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, @@ -1188,8 +1194,8 @@ async def sample_execute_batch_dml(): Example 2: - - Request: 5 DML statements. The third statement has - a syntax error. + - Request: 5 DML statements. The third statement has + a syntax error. \* Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, @@ -1243,7 +1249,7 @@ async def read( r"""Reads rows from the database using key lookups and scans, as a simple key/value style alternative to [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method - cannot be used to return a result set larger than 10 MiB; if the + can't 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. @@ -1573,7 +1579,7 @@ async def commit( any time; commonly, the cause is conflicts with concurrent transactions. However, it can also happen for a variety of other reasons. If ``Commit`` returns ``ABORTED``, the caller should - re-attempt the transaction from the beginning, re-using the same + retry the transaction from the beginning, reusing the same session. On very rare occasions, ``Commit`` might return ``UNKNOWN``. @@ -1643,7 +1649,7 @@ async def sample_commit(): 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 + the application, or in the transport library), it's possible that the mutations are executed more than once. If this is undesirable, use [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] @@ -1729,7 +1735,7 @@ async def rollback( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Rolls back a transaction, releasing any locks it holds. It is a + r"""Rolls back a transaction, releasing any locks it holds. It's a good idea to call this for any transaction that includes one or more [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and @@ -1737,8 +1743,7 @@ async def rollback( ``Rollback`` returns ``OK`` if it successfully aborts the transaction, the transaction was already aborted, or the - transaction is not found. ``Rollback`` never returns - ``ABORTED``. + transaction isn't found. ``Rollback`` never returns ``ABORTED``. .. code-block:: python @@ -1850,12 +1855,12 @@ async def partition_query( [ExecuteStreamingSql][google.spanner.v1.Spanner.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. + ``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 deleted, is idle for too long, begins a new transaction, - or becomes too old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the query, and the whole operation must be restarted from the beginning. @@ -1951,15 +1956,15 @@ async def partition_read( [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read result to read. The same session and read-only transaction must be used by the - PartitionReadRequest used to create the partition tokens and the - ReadRequests that use the partition tokens. There are no + ``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. + partition tokens, or even 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 old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the read, and the whole operation must be restarted from the beginning. @@ -2053,25 +2058,23 @@ def batch_write( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> Awaitable[AsyncIterable[spanner.BatchWriteResponse]]: - r"""Batches the supplied mutation groups in a collection - of efficient transactions. All mutations in a group are - committed atomically. However, mutations across groups - can be committed non-atomically in an unspecified order - and thus, they must be independent of each other. - Partial failure is possible, i.e., some groups may have - been committed successfully, while some may have failed. - The results of individual batches are streamed into the - response as the batches are applied. - - BatchWrite requests are not replay protected, meaning - that each mutation group may be applied more than once. - Replays of non-idempotent mutations may have undesirable - effects. For example, replays of an insert mutation may - produce an already exists error or if you use generated - or commit timestamp-based keys, it may result in - additional rows being added to the mutation's table. We - recommend structuring your mutation groups to be - idempotent to avoid this issue. + r"""Batches the supplied mutation groups in a collection of + efficient transactions. All mutations in a group are committed + atomically. However, mutations across groups can be committed + non-atomically in an unspecified order and thus, they must be + independent of each other. Partial failure is possible, that is, + some groups might have been committed successfully, while some + might have failed. The results of individual batches are + streamed into the response as the batches are applied. + + ``BatchWrite`` requests are not replay protected, meaning that + each mutation group can be applied more than once. Replays of + non-idempotent mutations can have undesirable effects. For + example, replays of an insert mutation can produce an already + exists error or if you use generated or commit timestamp-based + keys, it can result in additional rows being added to the + mutation's table. We recommend structuring your mutation groups + to be idempotent to avoid this issue. .. code-block:: python diff --git a/google/cloud/spanner_v1/services/spanner/client.py b/google/cloud/spanner_v1/services/spanner/client.py index e853b2dfd5..82dbf8375e 100644 --- a/google/cloud/spanner_v1/services/spanner/client.py +++ b/google/cloud/spanner_v1/services/spanner/client.py @@ -762,14 +762,14 @@ def create_session( transaction internally, and count toward the one transaction limit. - Active sessions use additional server resources, so it is a good + Active sessions use additional server resources, so it's a good idea to delete idle and unneeded sessions. Aside from explicit - deletes, Cloud Spanner may delete sessions for which no - operations are sent for more than an hour. If a session is - deleted, requests to it return ``NOT_FOUND``. + deletes, Cloud Spanner can delete sessions when no operations + are sent for more than an hour. If a session is deleted, + requests to it return ``NOT_FOUND``. Idle sessions can be kept alive by sending a trivial SQL query - periodically, e.g., ``"SELECT 1"``. + periodically, for example, ``"SELECT 1"``. .. code-block:: python @@ -922,10 +922,10 @@ def sample_batch_create_sessions(): should not be set. session_count (int): Required. The number of sessions to be created in this - batch call. The API may return fewer than the requested + batch call. The API can 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 + ``BatchCreateSessions`` (adjusting [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). @@ -1003,7 +1003,7 @@ def get_session( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> spanner.Session: - r"""Gets a session. Returns ``NOT_FOUND`` if the session does not + r"""Gets a session. Returns ``NOT_FOUND`` if the session doesn't exist. This is mainly useful for determining whether a session is still alive. @@ -1235,7 +1235,7 @@ def delete_session( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: r"""Ends a session, releasing server resources associated - with it. This will asynchronously trigger cancellation + with it. This asynchronously triggers the cancellation of any operations that are running with this session. .. code-block:: python @@ -1332,7 +1332,7 @@ def execute_sql( metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> result_set.ResultSet: r"""Executes an SQL statement, returning all results in a single - reply. This method cannot be used to return a result set larger + reply. This method can't 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. @@ -1346,6 +1346,9 @@ def execute_sql( [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + The query string can be SQL or `Graph Query Language + (GQL) `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -1437,6 +1440,9 @@ def execute_streaming_sql( individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB. + The query string can be SQL or `Graph Query Language + (GQL) `__. + .. code-block:: python # This snippet has been automatically generated and should be regarded as a @@ -1608,8 +1614,8 @@ def sample_execute_batch_dml(): Example 1: - - Request: 5 DML statements, all executed - successfully. + - Request: 5 DML statements, all executed + successfully. \* Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, @@ -1617,8 +1623,8 @@ def sample_execute_batch_dml(): Example 2: - - Request: 5 DML statements. The third statement has - a syntax error. + - Request: 5 DML statements. The third statement has + a syntax error. \* Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, @@ -1670,7 +1676,7 @@ def read( r"""Reads rows from the database using key lookups and scans, as a simple key/value style alternative to [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method - cannot be used to return a result set larger than 10 MiB; if the + can't 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. @@ -1995,7 +2001,7 @@ def commit( any time; commonly, the cause is conflicts with concurrent transactions. However, it can also happen for a variety of other reasons. If ``Commit`` returns ``ABORTED``, the caller should - re-attempt the transaction from the beginning, re-using the same + retry the transaction from the beginning, reusing the same session. On very rare occasions, ``Commit`` might return ``UNKNOWN``. @@ -2065,7 +2071,7 @@ def sample_commit(): 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 + the application, or in the transport library), it's possible that the mutations are executed more than once. If this is undesirable, use [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] @@ -2150,7 +2156,7 @@ def rollback( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> None: - r"""Rolls back a transaction, releasing any locks it holds. It is a + r"""Rolls back a transaction, releasing any locks it holds. It's a good idea to call this for any transaction that includes one or more [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and @@ -2158,8 +2164,7 @@ def rollback( ``Rollback`` returns ``OK`` if it successfully aborts the transaction, the transaction was already aborted, or the - transaction is not found. ``Rollback`` never returns - ``ABORTED``. + transaction isn't found. ``Rollback`` never returns ``ABORTED``. .. code-block:: python @@ -2270,12 +2275,12 @@ def partition_query( [ExecuteStreamingSql][google.spanner.v1.Spanner.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. + ``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 deleted, is idle for too long, begins a new transaction, - or becomes too old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the query, and the whole operation must be restarted from the beginning. @@ -2369,15 +2374,15 @@ def partition_read( [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read result to read. The same session and read-only transaction must be used by the - PartitionReadRequest used to create the partition tokens and the - ReadRequests that use the partition tokens. There are no + ``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. + partition tokens, or even 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 old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the read, and the whole operation must be restarted from the beginning. @@ -2469,25 +2474,23 @@ def batch_write( timeout: Union[float, object] = gapic_v1.method.DEFAULT, metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), ) -> Iterable[spanner.BatchWriteResponse]: - r"""Batches the supplied mutation groups in a collection - of efficient transactions. All mutations in a group are - committed atomically. However, mutations across groups - can be committed non-atomically in an unspecified order - and thus, they must be independent of each other. - Partial failure is possible, i.e., some groups may have - been committed successfully, while some may have failed. - The results of individual batches are streamed into the - response as the batches are applied. - - BatchWrite requests are not replay protected, meaning - that each mutation group may be applied more than once. - Replays of non-idempotent mutations may have undesirable - effects. For example, replays of an insert mutation may - produce an already exists error or if you use generated - or commit timestamp-based keys, it may result in - additional rows being added to the mutation's table. We - recommend structuring your mutation groups to be - idempotent to avoid this issue. + r"""Batches the supplied mutation groups in a collection of + efficient transactions. All mutations in a group are committed + atomically. However, mutations across groups can be committed + non-atomically in an unspecified order and thus, they must be + independent of each other. Partial failure is possible, that is, + some groups might have been committed successfully, while some + might have failed. The results of individual batches are + streamed into the response as the batches are applied. + + ``BatchWrite`` requests are not replay protected, meaning that + each mutation group can be applied more than once. Replays of + non-idempotent mutations can have undesirable effects. For + example, replays of an insert mutation can produce an already + exists error or if you use generated or commit timestamp-based + keys, it can result in additional rows being added to the + mutation's table. We recommend structuring your mutation groups + to be idempotent to avoid this issue. .. code-block:: python diff --git a/google/cloud/spanner_v1/services/spanner/transports/grpc.py b/google/cloud/spanner_v1/services/spanner/transports/grpc.py index 148abd592a..8b377d7725 100644 --- a/google/cloud/spanner_v1/services/spanner/transports/grpc.py +++ b/google/cloud/spanner_v1/services/spanner/transports/grpc.py @@ -354,14 +354,14 @@ def create_session( transaction internally, and count toward the one transaction limit. - Active sessions use additional server resources, so it is a good + Active sessions use additional server resources, so it's a good idea to delete idle and unneeded sessions. Aside from explicit - deletes, Cloud Spanner may delete sessions for which no - operations are sent for more than an hour. If a session is - deleted, requests to it return ``NOT_FOUND``. + deletes, Cloud Spanner can delete sessions when no operations + are sent for more than an hour. If a session is deleted, + requests to it return ``NOT_FOUND``. Idle sessions can be kept alive by sending a trivial SQL query - periodically, e.g., ``"SELECT 1"``. + periodically, for example, ``"SELECT 1"``. Returns: Callable[[~.CreateSessionRequest], @@ -417,7 +417,7 @@ def batch_create_sessions( def get_session(self) -> Callable[[spanner.GetSessionRequest], spanner.Session]: r"""Return a callable for the get session method over gRPC. - Gets a session. Returns ``NOT_FOUND`` if the session does not + Gets a session. Returns ``NOT_FOUND`` if the session doesn't exist. This is mainly useful for determining whether a session is still alive. @@ -472,7 +472,7 @@ def delete_session( r"""Return a callable for the delete session method over gRPC. Ends a session, releasing server resources associated - with it. This will asynchronously trigger cancellation + with it. This asynchronously triggers the cancellation of any operations that are running with this session. Returns: @@ -500,7 +500,7 @@ def execute_sql( r"""Return a callable for the execute sql method over gRPC. Executes an SQL statement, returning all results in a single - reply. This method cannot be used to return a result set larger + reply. This method can't 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. @@ -514,6 +514,9 @@ def execute_sql( [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + The query string can be SQL or `Graph Query Language + (GQL) `__. + Returns: Callable[[~.ExecuteSqlRequest], ~.ResultSet]: @@ -545,6 +548,9 @@ def execute_streaming_sql( individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB. + The query string can be SQL or `Graph Query Language + (GQL) `__. + Returns: Callable[[~.ExecuteSqlRequest], ~.PartialResultSet]: @@ -609,7 +615,7 @@ def read(self) -> Callable[[spanner.ReadRequest], result_set.ResultSet]: Reads rows from the database using key lookups and scans, as a simple key/value style alternative to [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method - cannot be used to return a result set larger than 10 MiB; if the + can't 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. @@ -714,7 +720,7 @@ def commit( any time; commonly, the cause is conflicts with concurrent transactions. However, it can also happen for a variety of other reasons. If ``Commit`` returns ``ABORTED``, the caller should - re-attempt the transaction from the beginning, re-using the same + retry the transaction from the beginning, reusing the same session. On very rare occasions, ``Commit`` might return ``UNKNOWN``. @@ -746,7 +752,7 @@ def commit( def rollback(self) -> Callable[[spanner.RollbackRequest], empty_pb2.Empty]: r"""Return a callable for the rollback method over gRPC. - Rolls back a transaction, releasing any locks it holds. It is a + Rolls back a transaction, releasing any locks it holds. It's a good idea to call this for any transaction that includes one or more [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and @@ -754,8 +760,7 @@ def rollback(self) -> Callable[[spanner.RollbackRequest], empty_pb2.Empty]: ``Rollback`` returns ``OK`` if it successfully aborts the transaction, the transaction was already aborted, or the - transaction is not found. ``Rollback`` never returns - ``ABORTED``. + transaction isn't found. ``Rollback`` never returns ``ABORTED``. Returns: Callable[[~.RollbackRequest], @@ -787,12 +792,12 @@ def partition_query( [ExecuteStreamingSql][google.spanner.v1.Spanner.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. + ``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 deleted, is idle for too long, begins a new transaction, - or becomes too old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the query, and the whole operation must be restarted from the beginning. @@ -826,15 +831,15 @@ def partition_read( [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read result to read. The same session and read-only transaction must be used by the - PartitionReadRequest used to create the partition tokens and the - ReadRequests that use the partition tokens. There are no + ``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. + partition tokens, or even 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 old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the read, and the whole operation must be restarted from the beginning. @@ -862,25 +867,23 @@ def batch_write( ) -> Callable[[spanner.BatchWriteRequest], spanner.BatchWriteResponse]: r"""Return a callable for the batch write method over gRPC. - Batches the supplied mutation groups in a collection - of efficient transactions. All mutations in a group are - committed atomically. However, mutations across groups - can be committed non-atomically in an unspecified order - and thus, they must be independent of each other. - Partial failure is possible, i.e., some groups may have - been committed successfully, while some may have failed. - The results of individual batches are streamed into the - response as the batches are applied. - - BatchWrite requests are not replay protected, meaning - that each mutation group may be applied more than once. - Replays of non-idempotent mutations may have undesirable - effects. For example, replays of an insert mutation may - produce an already exists error or if you use generated - or commit timestamp-based keys, it may result in - additional rows being added to the mutation's table. We - recommend structuring your mutation groups to be - idempotent to avoid this issue. + Batches the supplied mutation groups in a collection of + efficient transactions. All mutations in a group are committed + atomically. However, mutations across groups can be committed + non-atomically in an unspecified order and thus, they must be + independent of each other. Partial failure is possible, that is, + some groups might have been committed successfully, while some + might have failed. The results of individual batches are + streamed into the response as the batches are applied. + + ``BatchWrite`` requests are not replay protected, meaning that + each mutation group can be applied more than once. Replays of + non-idempotent mutations can have undesirable effects. For + example, replays of an insert mutation can produce an already + exists error or if you use generated or commit timestamp-based + keys, it can result in additional rows being added to the + mutation's table. We recommend structuring your mutation groups + to be idempotent to avoid this issue. Returns: Callable[[~.BatchWriteRequest], diff --git a/google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py b/google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py index 86ac4915d7..2c6cec52a9 100644 --- a/google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py +++ b/google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py @@ -354,14 +354,14 @@ def create_session( transaction internally, and count toward the one transaction limit. - Active sessions use additional server resources, so it is a good + Active sessions use additional server resources, so it's a good idea to delete idle and unneeded sessions. Aside from explicit - deletes, Cloud Spanner may delete sessions for which no - operations are sent for more than an hour. If a session is - deleted, requests to it return ``NOT_FOUND``. + deletes, Cloud Spanner can delete sessions when no operations + are sent for more than an hour. If a session is deleted, + requests to it return ``NOT_FOUND``. Idle sessions can be kept alive by sending a trivial SQL query - periodically, e.g., ``"SELECT 1"``. + periodically, for example, ``"SELECT 1"``. Returns: Callable[[~.CreateSessionRequest], @@ -420,7 +420,7 @@ def get_session( ) -> Callable[[spanner.GetSessionRequest], Awaitable[spanner.Session]]: r"""Return a callable for the get session method over gRPC. - Gets a session. Returns ``NOT_FOUND`` if the session does not + Gets a session. Returns ``NOT_FOUND`` if the session doesn't exist. This is mainly useful for determining whether a session is still alive. @@ -477,7 +477,7 @@ def delete_session( r"""Return a callable for the delete session method over gRPC. Ends a session, releasing server resources associated - with it. This will asynchronously trigger cancellation + with it. This asynchronously triggers the cancellation of any operations that are running with this session. Returns: @@ -505,7 +505,7 @@ def execute_sql( r"""Return a callable for the execute sql method over gRPC. Executes an SQL statement, returning all results in a single - reply. This method cannot be used to return a result set larger + reply. This method can't 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. @@ -519,6 +519,9 @@ def execute_sql( [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead. + The query string can be SQL or `Graph Query Language + (GQL) `__. + Returns: Callable[[~.ExecuteSqlRequest], Awaitable[~.ResultSet]]: @@ -550,6 +553,9 @@ def execute_streaming_sql( individual row in the result set can exceed 100 MiB, and no column value can exceed 10 MiB. + The query string can be SQL or `Graph Query Language + (GQL) `__. + Returns: Callable[[~.ExecuteSqlRequest], Awaitable[~.PartialResultSet]]: @@ -616,7 +622,7 @@ def read(self) -> Callable[[spanner.ReadRequest], Awaitable[result_set.ResultSet Reads rows from the database using key lookups and scans, as a simple key/value style alternative to [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method - cannot be used to return a result set larger than 10 MiB; if the + can't 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. @@ -723,7 +729,7 @@ def commit( any time; commonly, the cause is conflicts with concurrent transactions. However, it can also happen for a variety of other reasons. If ``Commit`` returns ``ABORTED``, the caller should - re-attempt the transaction from the beginning, re-using the same + retry the transaction from the beginning, reusing the same session. On very rare occasions, ``Commit`` might return ``UNKNOWN``. @@ -757,7 +763,7 @@ def rollback( ) -> Callable[[spanner.RollbackRequest], Awaitable[empty_pb2.Empty]]: r"""Return a callable for the rollback method over gRPC. - Rolls back a transaction, releasing any locks it holds. It is a + Rolls back a transaction, releasing any locks it holds. It's a good idea to call this for any transaction that includes one or more [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and @@ -765,8 +771,7 @@ def rollback( ``Rollback`` returns ``OK`` if it successfully aborts the transaction, the transaction was already aborted, or the - transaction is not found. ``Rollback`` never returns - ``ABORTED``. + transaction isn't found. ``Rollback`` never returns ``ABORTED``. Returns: Callable[[~.RollbackRequest], @@ -800,12 +805,12 @@ def partition_query( [ExecuteStreamingSql][google.spanner.v1.Spanner.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. + ``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 deleted, is idle for too long, begins a new transaction, - or becomes too old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the query, and the whole operation must be restarted from the beginning. @@ -839,15 +844,15 @@ def partition_read( [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read result to read. The same session and read-only transaction must be used by the - PartitionReadRequest used to create the partition tokens and the - ReadRequests that use the partition tokens. There are no + ``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. + partition tokens, or even 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 old. When any of these happen, it is not possible + or becomes too old. When any of these happen, it isn't possible to resume the read, and the whole operation must be restarted from the beginning. @@ -875,25 +880,23 @@ def batch_write( ) -> Callable[[spanner.BatchWriteRequest], Awaitable[spanner.BatchWriteResponse]]: r"""Return a callable for the batch write method over gRPC. - Batches the supplied mutation groups in a collection - of efficient transactions. All mutations in a group are - committed atomically. However, mutations across groups - can be committed non-atomically in an unspecified order - and thus, they must be independent of each other. - Partial failure is possible, i.e., some groups may have - been committed successfully, while some may have failed. - The results of individual batches are streamed into the - response as the batches are applied. - - BatchWrite requests are not replay protected, meaning - that each mutation group may be applied more than once. - Replays of non-idempotent mutations may have undesirable - effects. For example, replays of an insert mutation may - produce an already exists error or if you use generated - or commit timestamp-based keys, it may result in - additional rows being added to the mutation's table. We - recommend structuring your mutation groups to be - idempotent to avoid this issue. + Batches the supplied mutation groups in a collection of + efficient transactions. All mutations in a group are committed + atomically. However, mutations across groups can be committed + non-atomically in an unspecified order and thus, they must be + independent of each other. Partial failure is possible, that is, + some groups might have been committed successfully, while some + might have failed. The results of individual batches are + streamed into the response as the batches are applied. + + ``BatchWrite`` requests are not replay protected, meaning that + each mutation group can be applied more than once. Replays of + non-idempotent mutations can have undesirable effects. For + example, replays of an insert mutation can produce an already + exists error or if you use generated or commit timestamp-based + keys, it can result in additional rows being added to the + mutation's table. We recommend structuring your mutation groups + to be idempotent to avoid this issue. Returns: Callable[[~.BatchWriteRequest], diff --git a/google/cloud/spanner_v1/services/spanner/transports/rest.py b/google/cloud/spanner_v1/services/spanner/transports/rest.py index 7ad0a4e24e..7b49a0d76a 100644 --- a/google/cloud/spanner_v1/services/spanner/transports/rest.py +++ b/google/cloud/spanner_v1/services/spanner/transports/rest.py @@ -1259,6 +1259,22 @@ def __call__( resp, _ = self._interceptor.post_batch_write_with_metadata( resp, response_metadata ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + http_response = { + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.spanner_v1.SpannerClient.batch_write", + extra={ + "serviceName": "google.spanner.v1.Spanner", + "rpcName": "BatchWrite", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) return resp class _BeginTransaction( @@ -1910,20 +1926,20 @@ def __call__( Example 1: - - Request: 5 DML statements, all executed successfully. - - Response: 5 [ResultSet][google.spanner.v1.ResultSet] - messages, with the status ``OK``. + - Request: 5 DML statements, all executed successfully. + - Response: 5 [ResultSet][google.spanner.v1.ResultSet] + messages, with the status ``OK``. Example 2: - - Request: 5 DML statements. The third statement has a - syntax error. - - Response: 2 [ResultSet][google.spanner.v1.ResultSet] - messages, and a syntax error (``INVALID_ARGUMENT``) - status. The number of - [ResultSet][google.spanner.v1.ResultSet] messages - indicates that the third statement failed, and the - fourth and fifth statements were not executed. + - Request: 5 DML statements. The third statement has a + syntax error. + - Response: 2 [ResultSet][google.spanner.v1.ResultSet] + messages, and a syntax error (``INVALID_ARGUMENT``) + status. The number of + [ResultSet][google.spanner.v1.ResultSet] messages + indicates that the third statement failed, and the + fourth and fifth statements were not executed. """ @@ -2320,6 +2336,22 @@ def __call__( resp, _ = self._interceptor.post_execute_streaming_sql_with_metadata( resp, response_metadata ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + http_response = { + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.spanner_v1.SpannerClient.execute_streaming_sql", + extra={ + "serviceName": "google.spanner.v1.Spanner", + "rpcName": "ExecuteStreamingSql", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) return resp class _GetSession(_BaseSpannerRestTransport._BaseGetSession, SpannerRestStub): @@ -3331,6 +3363,22 @@ def __call__( resp, _ = self._interceptor.post_streaming_read_with_metadata( resp, response_metadata ) + if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor( + logging.DEBUG + ): # pragma: NO COVER + http_response = { + "headers": dict(response.headers), + "status": response.status_code, + } + _LOGGER.debug( + "Received response for google.spanner_v1.SpannerClient.streaming_read", + extra={ + "serviceName": "google.spanner.v1.Spanner", + "rpcName": "StreamingRead", + "metadata": http_response["headers"], + "httpResponse": http_response, + }, + ) return resp @property diff --git a/google/cloud/spanner_v1/types/change_stream.py b/google/cloud/spanner_v1/types/change_stream.py index fb88824c19..762fc6a5d5 100644 --- a/google/cloud/spanner_v1/types/change_stream.py +++ b/google/cloud/spanner_v1/types/change_stream.py @@ -42,7 +42,7 @@ class ChangeStreamRecord(proto.Message): partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special Table-Valued Function (TVF) along with each Change Streams. The function provides access to the change stream's records. The - function is named READ_ (where + function is named READ\_ (where is the name of the change stream), and it returns a table with only one column called ChangeRecord. diff --git a/google/cloud/spanner_v1/types/result_set.py b/google/cloud/spanner_v1/types/result_set.py index 68119316d2..697d0fd33b 100644 --- a/google/cloud/spanner_v1/types/result_set.py +++ b/google/cloud/spanner_v1/types/result_set.py @@ -120,15 +120,15 @@ class PartialResultSet(proto.Message): field. Two or more chunked values can be merged to form a complete value as follows: - - ``bool/number/null``: can't be chunked - - ``string``: concatenate the strings - - ``list``: concatenate the lists. If the last element in a - list is a ``string``, ``list``, or ``object``, merge it - with the first element in the next list by applying these - rules recursively. - - ``object``: concatenate the (field name, field value) - pairs. If a field name is duplicated, then apply these - rules recursively to merge the field values. + - ``bool/number/null``: can't be chunked + - ``string``: concatenate the strings + - ``list``: concatenate the lists. If the last element in a + list is a ``string``, ``list``, or ``object``, merge it + with the first element in the next list by applying these + rules recursively. + - ``object``: concatenate the (field name, field value) + pairs. If a field name is duplicated, then apply these + rules recursively to merge the field values. Some examples of merging: diff --git a/google/cloud/spanner_v1/types/spanner.py b/google/cloud/spanner_v1/types/spanner.py index 67f1093448..9e7a477b46 100644 --- a/google/cloud/spanner_v1/types/spanner.py +++ b/google/cloud/spanner_v1/types/spanner.py @@ -93,13 +93,12 @@ class BatchCreateSessionsRequest(proto.Message): Required. The database in which the new sessions are created. session_template (google.cloud.spanner_v1.types.Session): - Parameters to be applied to each created - session. + Parameters to apply to each created session. 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 + call. The API can return fewer than the requested number of sessions. If a specific number of sessions are desired, the - client can make additional calls to BatchCreateSessions + client can make additional calls to ``BatchCreateSessions`` (adjusting [session_count][google.spanner.v1.BatchCreateSessionsRequest.session_count] as necessary). @@ -146,14 +145,14 @@ class Session(proto.Message): labels (MutableMapping[str, str]): The labels for the session. - - Label keys must be between 1 and 63 characters long and - must conform to the following regular expression: - ``[a-z]([-a-z0-9]*[a-z0-9])?``. - - Label values must be between 0 and 63 characters long and - must conform to the regular expression - ``([a-z]([-a-z0-9]*[a-z0-9])?)?``. - - No more than 64 labels can be associated with a given - session. + - Label keys must be between 1 and 63 characters long and + must conform to the following regular expression: + ``[a-z]([-a-z0-9]*[a-z0-9])?``. + - Label values must be between 0 and 63 characters long and + must conform to the regular expression + ``([a-z]([-a-z0-9]*[a-z0-9])?)?``. + - No more than 64 labels can be associated with a given + session. See https://goo.gl/xmQnxf for more information on and examples of labels. @@ -162,20 +161,20 @@ class Session(proto.Message): is created. approximate_last_use_time (google.protobuf.timestamp_pb2.Timestamp): Output only. The approximate timestamp when - the session is last used. It is typically - earlier than the actual last use time. + the session is last used. It's typically earlier + than the actual last use time. creator_role (str): The database role which created this session. multiplexed (bool): - Optional. If true, specifies a multiplexed session. A - multiplexed session may be used for multiple, concurrent - read-only operations but can not be used for read-write - transactions, partitioned reads, or partitioned queries. - Multiplexed sessions can be created via - [CreateSession][google.spanner.v1.Spanner.CreateSession] but - not via - [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions]. - Multiplexed sessions may not be deleted nor listed. + Optional. If ``true``, specifies a multiplexed session. Use + a multiplexed session for multiple, concurrent read-only + operations. Don't use them for read-write transactions, + partitioned reads, or partitioned queries. Use + [``sessions.create``][google.spanner.v1.Spanner.CreateSession] + to create multiplexed sessions. Don't use + [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions] + to create a multiplexed session. You can't delete or list + multiplexed sessions. """ name: str = proto.Field( @@ -244,13 +243,13 @@ class ListSessionsRequest(proto.Message): Filter rules are case insensitive. The fields eligible for filtering are: - - ``labels.key`` where key is the name of a label + - ``labels.key`` where key is the name of a label Some examples of using filters are: - - ``labels.env:*`` --> The session has the label "env". - - ``labels.env:dev`` --> The session has the label "env" - and the value of the label contains the string "dev". + - ``labels.env:*`` --> The session has the label "env". + - ``labels.env:dev`` --> The session has the label "env" and + the value of the label contains the string "dev". """ database: str = proto.Field( @@ -322,47 +321,47 @@ class RequestOptions(proto.Message): Priority for the request. request_tag (str): A per-request tag which can be applied to queries or reads, - used for statistics collection. Both request_tag and - transaction_tag can be specified for a read or query that - belongs to a transaction. This field is ignored for requests - where it's not applicable (e.g. CommitRequest). Legal - characters for ``request_tag`` values are all printable - characters (ASCII 32 - 126) and the length of a request_tag - is limited to 50 characters. Values that exceed this limit - are truncated. Any leading underscore (_) characters will be - removed from the string. + used for statistics collection. Both ``request_tag`` and + ``transaction_tag`` can be specified for a read or query + that belongs to a transaction. This field is ignored for + requests where it's not applicable (for example, + ``CommitRequest``). Legal characters for ``request_tag`` + values are all printable characters (ASCII 32 - 126) and the + length of a request_tag is limited to 50 characters. Values + that exceed this limit are truncated. Any leading underscore + (\_) characters are removed from the string. transaction_tag (str): A tag used for statistics collection about this transaction. - Both request_tag and transaction_tag can be specified for a - read or query that belongs to a transaction. The value of - transaction_tag should be the same for all requests - belonging to the same transaction. If this request doesn't - belong to any transaction, transaction_tag will be ignored. - Legal characters for ``transaction_tag`` values are all - printable characters (ASCII 32 - 126) and the length of a - transaction_tag is limited to 50 characters. Values that - exceed this limit are truncated. Any leading underscore (_) - characters will be removed from the string. + Both ``request_tag`` and ``transaction_tag`` can be + specified for a read or query that belongs to a transaction. + The value of transaction_tag should be the same for all + requests belonging to the same transaction. If this request + doesn't belong to any transaction, ``transaction_tag`` is + ignored. Legal characters for ``transaction_tag`` values are + all printable characters (ASCII 32 - 126) and the length of + a ``transaction_tag`` is limited to 50 characters. Values + that exceed this limit are truncated. Any leading underscore + (\_) characters are removed from the string. """ class Priority(proto.Enum): - r"""The relative priority for requests. Note that priority is not + r"""The relative priority for requests. Note that priority isn't applicable for [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction]. - The priority acts as a hint to the Cloud Spanner scheduler and does - not guarantee priority or order of execution. For example: + The priority acts as a hint to the Cloud Spanner scheduler and + doesn't guarantee priority or order of execution. For example: - - Some parts of a write operation always execute at - ``PRIORITY_HIGH``, regardless of the specified priority. This may - cause you to see an increase in high priority workload even when - executing a low priority request. This can also potentially cause - a priority inversion where a lower priority request will be - fulfilled ahead of a higher priority request. - - If a transaction contains multiple operations with different - priorities, Cloud Spanner does not guarantee to process the - higher priority operations first. There may be other constraints - to satisfy, such as order of operations. + - Some parts of a write operation always execute at + ``PRIORITY_HIGH``, regardless of the specified priority. This can + cause you to see an increase in high priority workload even when + executing a low priority request. This can also potentially cause + a priority inversion where a lower priority request is fulfilled + ahead of a higher priority request. + - If a transaction contains multiple operations with different + priorities, Cloud Spanner doesn't guarantee to process the higher + priority operations first. There might be other constraints to + satisfy, such as the order of operations. Values: PRIORITY_UNSPECIFIED (0): @@ -398,11 +397,11 @@ class Priority(proto.Enum): class DirectedReadOptions(proto.Message): - r"""The DirectedReadOptions can be used to indicate which replicas or - regions should be used for non-transactional reads or queries. + r"""The ``DirectedReadOptions`` can be used to indicate which replicas + or regions should be used for non-transactional reads or queries. - DirectedReadOptions may only be specified for a read-only - transaction, otherwise the API will return an ``INVALID_ARGUMENT`` + ``DirectedReadOptions`` can only be specified for a read-only + transaction, otherwise the API returns an ``INVALID_ARGUMENT`` error. This message has `oneof`_ fields (mutually exclusive fields). @@ -414,18 +413,18 @@ class DirectedReadOptions(proto.Message): Attributes: include_replicas (google.cloud.spanner_v1.types.DirectedReadOptions.IncludeReplicas): - Include_replicas indicates the order of replicas (as they - appear in this list) to process the request. If - auto_failover_disabled is set to true and all replicas are - exhausted without finding a healthy replica, Spanner will - wait for a replica in the list to become available, requests - may fail due to ``DEADLINE_EXCEEDED`` errors. + ``Include_replicas`` indicates the order of replicas (as + they appear in this list) to process the request. If + ``auto_failover_disabled`` is set to ``true`` and all + replicas are exhausted without finding a healthy replica, + Spanner waits for a replica in the list to become available, + requests might fail due to ``DEADLINE_EXCEEDED`` errors. This field is a member of `oneof`_ ``replicas``. exclude_replicas (google.cloud.spanner_v1.types.DirectedReadOptions.ExcludeReplicas): - Exclude_replicas indicates that specified replicas should be - excluded from serving requests. Spanner will not route - requests to the replicas in this list. + ``Exclude_replicas`` indicates that specified replicas + should be excluded from serving requests. Spanner doesn't + route requests to the replicas in this list. This field is a member of `oneof`_ ``replicas``. """ @@ -434,24 +433,23 @@ class ReplicaSelection(proto.Message): r"""The directed read replica selector. Callers must provide one or more of the following fields for replica selection: - - ``location`` - The location must be one of the regions within the - multi-region configuration of your database. - - ``type`` - The type of the replica. + - ``location`` - The location must be one of the regions within the + multi-region configuration of your database. + - ``type`` - The type of the replica. Some examples of using replica_selectors are: - - ``location:us-east1`` --> The "us-east1" replica(s) of any - available type will be used to process the request. - - ``type:READ_ONLY`` --> The "READ_ONLY" type replica(s) in nearest - available location will be used to process the request. - - ``location:us-east1 type:READ_ONLY`` --> The "READ_ONLY" type - replica(s) in location "us-east1" will be used to process the - request. + - ``location:us-east1`` --> The "us-east1" replica(s) of any + available type is used to process the request. + - ``type:READ_ONLY`` --> The "READ_ONLY" type replica(s) in the + nearest available location are used to process the request. + - ``location:us-east1 type:READ_ONLY`` --> The "READ_ONLY" type + replica(s) in location "us-east1" is used to process the request. Attributes: location (str): The location or region of the serving - requests, e.g. "us-east1". + requests, for example, "us-east1". type_ (google.cloud.spanner_v1.types.DirectedReadOptions.ReplicaSelection.Type): The type of replica. """ @@ -484,18 +482,18 @@ class Type(proto.Enum): ) class IncludeReplicas(proto.Message): - r"""An IncludeReplicas contains a repeated set of - ReplicaSelection which indicates the order in which replicas + r"""An ``IncludeReplicas`` contains a repeated set of + ``ReplicaSelection`` which indicates the order in which replicas should be considered. Attributes: replica_selections (MutableSequence[google.cloud.spanner_v1.types.DirectedReadOptions.ReplicaSelection]): The directed read replica selector. auto_failover_disabled (bool): - If true, Spanner will not route requests to a replica - outside the include_replicas list when all of the specified - replicas are unavailable or unhealthy. Default value is - ``false``. + If ``true``, Spanner doesn't route requests to a replica + outside the <``include_replicas`` list when all of the + specified replicas are unavailable or unhealthy. Default + value is ``false``. """ replica_selections: MutableSequence[ @@ -559,7 +557,7 @@ class ExecuteSqlRequest(proto.Message): Standard DML statements require a read-write transaction. To protect against replays, - single-use transactions are not supported. The + single-use transactions are not supported. The caller must either supply an existing transaction ID or begin a new transaction. @@ -583,16 +581,16 @@ class ExecuteSqlRequest(proto.Message): ``"WHERE id > @msg_id AND id < @msg_id + 100"`` - It is an error to execute a SQL statement with unbound + It's an error to execute a SQL statement with unbound parameters. param_types (MutableMapping[str, google.cloud.spanner_v1.types.Type]): - It is not always possible for Cloud Spanner to infer the + It isn't 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][google.spanner.v1.ExecuteSqlRequest.params] as JSON strings. - In these cases, ``param_types`` can be used to specify the + In these cases, you can use ``param_types`` to specify the exact SQL type for some or all of the SQL statement parameters. See the definition of [Type][google.spanner.v1.Type] for more information about @@ -615,24 +613,23 @@ class ExecuteSqlRequest(proto.Message): can only be set to [QueryMode.NORMAL][google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL]. partition_token (bytes): - If present, results will be restricted to the specified - partition previously created using PartitionQuery(). There + If present, results are 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. + this message and the ``PartitionQueryRequest`` message used + to create this ``partition_token``. seqno (int): 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. + received multiple times, at most one succeeds. The sequence number must be monotonically increasing within the transaction. If a request arrives for the first time with an out-of-order - sequence number, the transaction may be aborted. - Replays of previously handled requests will - yield the same response as the first execution. + sequence number, the transaction can be aborted. + Replays of previously handled requests yield the + same response as the first execution. Required for DML statements. Ignored for queries. @@ -648,23 +645,21 @@ class ExecuteSqlRequest(proto.Message): ``true``, the request is executed with Spanner Data Boost independent compute resources. - If the field is set to ``true`` but the request does not set + If the field is set to ``true`` but the request doesn't set ``partition_token``, the API returns an ``INVALID_ARGUMENT`` error. last_statement (bool): - Optional. If set to true, this statement - marks the end of the transaction. The - transaction should be committed or aborted after - this statement executes, and attempts to execute - any other requests against this transaction - (including reads and queries) will be rejected. - - For DML statements, setting this option may - cause some error reporting to be deferred until - commit time (e.g. validation of unique - constraints). Given this, successful execution - of a DML statement should not be assumed until a - subsequent Commit call completes successfully. + Optional. If set to ``true``, this statement marks the end + of the transaction. After this statement executes, you must + commit or abort the transaction. Attempts to execute any + other requests against this transaction (including reads and + queries) are rejected. + + For DML statements, setting this option might cause some + error reporting to be deferred until commit time (for + example, validation of unique constraints). Given this, + successful execution of a DML statement shouldn't be assumed + until a subsequent ``Commit`` call completes successfully. """ class QueryMode(proto.Enum): @@ -683,8 +678,8 @@ class QueryMode(proto.Enum): execution statistics, operator level execution statistics along with the results. This has a performance overhead compared to the other - modes. It is not recommended to use this mode - for production traffic. + modes. It isn't recommended to use this mode for + production traffic. WITH_STATS (3): This mode returns the overall (but not operator-level) execution statistics along with @@ -718,7 +713,7 @@ class QueryOptions(proto.Message): default optimizer version for query execution. The list of supported optimizer versions can be queried from - SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS. + ``SPANNER_SYS.SUPPORTED_OPTIMIZER_VERSIONS``. Executing a SQL statement with an invalid optimizer version fails with an ``INVALID_ARGUMENT`` error. @@ -740,13 +735,13 @@ class QueryOptions(proto.Message): use the latest generated statistics package. If not specified, Cloud Spanner uses the statistics package set at the database level options, or the latest package if the - database option is not set. + database option isn't set. The statistics package requested by the query has to be exempt from garbage collection. This can be achieved with the following DDL statement: - :: + .. code:: sql ALTER STATISTICS SET OPTIONS (allow_gc=false) @@ -861,31 +856,29 @@ class ExecuteBatchDmlRequest(proto.Message): Required. 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. + is received multiple times, at most one + succeeds. The sequence number must be monotonically increasing within the transaction. If a request arrives for the first time with an out-of-order - sequence number, the transaction may be aborted. - Replays of previously handled requests will + sequence number, the transaction might be + aborted. Replays of previously handled requests yield the same response as the first execution. request_options (google.cloud.spanner_v1.types.RequestOptions): Common options for this request. last_statements (bool): - Optional. If set to true, this request marks - the end of the transaction. The transaction - should be committed or aborted after these - statements execute, and attempts to execute any - other requests against this transaction - (including reads and queries) will be rejected. - - Setting this option may cause some error - reporting to be deferred until commit time (e.g. - validation of unique constraints). Given this, - successful execution of statements should not be - assumed until a subsequent Commit call completes - successfully. + Optional. If set to ``true``, this request marks the end of + the transaction. After these statements execute, you must + commit or abort the transaction. Attempts to execute any + other requests against this transaction (including reads and + queries) are rejected. + + Setting this option might cause some error reporting to be + deferred until commit time (for example, validation of + unique constraints). Given this, successful execution of + statements shouldn't be assumed until a subsequent + ``Commit`` call completes successfully. """ class Statement(proto.Message): @@ -909,10 +902,10 @@ class Statement(proto.Message): ``"WHERE id > @msg_id AND id < @msg_id + 100"`` - It is an error to execute a SQL statement with unbound + It's an error to execute a SQL statement with unbound parameters. param_types (MutableMapping[str, google.cloud.spanner_v1.types.Type]): - It is not always possible for Cloud Spanner to infer the + It isn't 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][google.spanner.v1.ExecuteBatchDmlRequest.Statement.params] @@ -991,19 +984,18 @@ class ExecuteBatchDmlResponse(proto.Message): Example 1: - - Request: 5 DML statements, all executed successfully. - - Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, - with the status ``OK``. + - Request: 5 DML statements, all executed successfully. + - Response: 5 [ResultSet][google.spanner.v1.ResultSet] messages, + with the status ``OK``. Example 2: - - Request: 5 DML statements. The third statement has a syntax - error. - - Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, - and a syntax error (``INVALID_ARGUMENT``) status. The number of - [ResultSet][google.spanner.v1.ResultSet] messages indicates that - the third statement failed, and the fourth and fifth statements - were not executed. + - Request: 5 DML statements. The third statement has a syntax error. + - Response: 2 [ResultSet][google.spanner.v1.ResultSet] messages, and + a syntax error (``INVALID_ARGUMENT``) status. The number of + [ResultSet][google.spanner.v1.ResultSet] messages indicates that + the third statement failed, and the fourth and fifth statements + were not executed. Attributes: result_sets (MutableSequence[google.cloud.spanner_v1.types.ResultSet]): @@ -1024,13 +1016,12 @@ class ExecuteBatchDmlResponse(proto.Message): is ``OK``. Otherwise, the error status of the first failed statement. precommit_token (google.cloud.spanner_v1.types.MultiplexedSessionPrecommitToken): - Optional. A precommit token will be included if the - read-write transaction is on a multiplexed session. The - precommit token with the highest sequence number from this - transaction attempt should be passed to the + Optional. A precommit token is included if the read-write + transaction is on a multiplexed session. Pass the precommit + token with the highest sequence number from this transaction + attempt should be passed to the [Commit][google.spanner.v1.Spanner.Commit] request for this - transaction. This feature is not yet supported and will - result in an UNIMPLEMENTED error. + transaction. """ result_sets: MutableSequence[result_set.ResultSet] = proto.RepeatedField( @@ -1051,28 +1042,28 @@ class ExecuteBatchDmlResponse(proto.Message): class PartitionOptions(proto.Message): - r"""Options for a PartitionQueryRequest and - PartitionReadRequest. + r"""Options for a ``PartitionQueryRequest`` and + ``PartitionReadRequest``. Attributes: partition_size_bytes (int): - **Note:** This hint is currently ignored by PartitionQuery - and PartitionRead requests. + **Note:** This hint is currently ignored by + ``PartitionQuery`` and ``PartitionRead`` requests. The desired data size for each partition generated. The default for this option is currently 1 GiB. This is only a - hint. The actual size of each partition may be smaller or + hint. The actual size of each partition can be smaller or larger than this size request. max_partitions (int): - **Note:** This hint is currently ignored by PartitionQuery - and PartitionRead requests. + **Note:** This hint is currently ignored by + ``PartitionQuery`` and ``PartitionRead`` requests. The desired maximum number of partitions to return. For - example, this may be set to the number of workers available. - The default for this option is currently 10,000. The maximum - value is currently 200,000. This is only a hint. The actual - number of partitions returned may be smaller or larger than - this maximum count request. + example, this might be set to the number of workers + available. The default for this option is currently 10,000. + The maximum value is currently 200,000. This is only a hint. + The actual number of partitions returned can be smaller or + larger than this maximum count request. """ partition_size_bytes: int = proto.Field( @@ -1094,23 +1085,23 @@ class PartitionQueryRequest(proto.Message): Required. The session used to create the partitions. transaction (google.cloud.spanner_v1.types.TransactionSelector): - Read only snapshot transactions are - supported, read/write and single use + Read-only snapshot transactions are + supported, read and write and single-use transactions are not. sql (str): Required. The query request to generate partitions for. The - request will fail if the query is not root partitionable. - For a query to be root partitionable, it needs to satisfy a - few conditions. For example, if the query execution plan + request fails if the query isn't root partitionable. For a + query to be root partitionable, it needs to satisfy a few + conditions. For example, if the query execution plan contains a distributed union operator, then it must be the first operator in the plan. For more information about other conditions, see `Read data in parallel `__. The query request must not contain DML commands, such as - INSERT, UPDATE, or DELETE. Use - [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] - with a PartitionedDml transaction for large, + ``INSERT``, ``UPDATE``, or ``DELETE``. Use + [``ExecuteStreamingSql``][google.spanner.v1.Spanner.ExecuteStreamingSql] + with a ``PartitionedDml`` transaction for large, partition-friendly DML operations. params (google.protobuf.struct_pb2.Struct): Parameter names and values that bind to placeholders in the @@ -1127,10 +1118,10 @@ class PartitionQueryRequest(proto.Message): ``"WHERE id > @msg_id AND id < @msg_id + 100"`` - It is an error to execute a SQL statement with unbound + It's an error to execute a SQL statement with unbound parameters. param_types (MutableMapping[str, google.cloud.spanner_v1.types.Type]): - It is not always possible for Cloud Spanner to infer the + It isn't 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][google.spanner.v1.PartitionQueryRequest.params] as @@ -1217,8 +1208,8 @@ class PartitionReadRequest(proto.Message): instead names index keys in [index][google.spanner.v1.PartitionReadRequest.index]. - It is not an error for the ``key_set`` to name rows that do - not exist in the database. Read yields nothing for + It isn't an error for the ``key_set`` to name rows that + don't exist in the database. Read yields nothing for nonexistent rows. partition_options (google.cloud.spanner_v1.types.PartitionOptions): Additional options that affect how many @@ -1264,10 +1255,9 @@ class Partition(proto.Message): Attributes: partition_token (bytes): - This token can be passed to Read, - StreamingRead, ExecuteSql, or - ExecuteStreamingSql requests to restrict the - results to those identified by this partition + This token can be passed to ``Read``, ``StreamingRead``, + ``ExecuteSql``, or ``ExecuteStreamingSql`` requests to + restrict the results to those identified by this partition token. """ @@ -1347,16 +1337,15 @@ class ReadRequest(proto.Message): [index][google.spanner.v1.ReadRequest.index] is non-empty). If the [partition_token][google.spanner.v1.ReadRequest.partition_token] - field is not empty, rows will be yielded in an unspecified - order. + field isn't empty, rows are yielded in an unspecified order. - It is not an error for the ``key_set`` to name rows that do - not exist in the database. Read yields nothing for + It isn't an error for the ``key_set`` to name rows that + don't exist in the database. Read yields nothing for nonexistent rows. limit (int): If greater than zero, only the first ``limit`` rows are yielded. If ``limit`` is zero, the default is no limit. A - limit cannot be specified if ``partition_token`` is set. + limit can't be specified if ``partition_token`` is set. resume_token (bytes): If this request is resuming a previously interrupted read, ``resume_token`` should be copied from the last @@ -1366,8 +1355,8 @@ class ReadRequest(proto.Message): request parameters must exactly match the request that yielded this token. partition_token (bytes): - If present, results will be restricted to the specified - partition previously created using PartitionRead(). There + If present, results are 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. @@ -1380,19 +1369,19 @@ class ReadRequest(proto.Message): ``true``, the request is executed with Spanner Data Boost independent compute resources. - If the field is set to ``true`` but the request does not set + If the field is set to ``true`` but the request doesn't set ``partition_token``, the API returns an ``INVALID_ARGUMENT`` error. order_by (google.cloud.spanner_v1.types.ReadRequest.OrderBy): Optional. Order for the returned rows. - By default, Spanner will return result rows in primary key - order except for PartitionRead requests. For applications - that do not require rows to be returned in primary key + By default, Spanner returns result rows in primary key order + except for PartitionRead requests. For applications that + don't require rows to be returned in primary key (``ORDER_BY_PRIMARY_KEY``) order, setting ``ORDER_BY_NO_ORDER`` option allows Spanner to optimize row retrieval, resulting in lower latencies in certain cases - (e.g. bulk point lookups). + (for example, bulk point lookups). lock_hint (google.cloud.spanner_v1.types.ReadRequest.LockHint): Optional. Lock Hint for the request, it can only be used with read-write transactions. @@ -1406,12 +1395,13 @@ class OrderBy(proto.Enum): ORDER_BY_UNSPECIFIED (0): Default value. - ORDER_BY_UNSPECIFIED is equivalent to ORDER_BY_PRIMARY_KEY. + ``ORDER_BY_UNSPECIFIED`` is equivalent to + ``ORDER_BY_PRIMARY_KEY``. ORDER_BY_PRIMARY_KEY (1): Read rows are returned in primary key order. In the event that this option is used in conjunction with - the ``partition_token`` field, the API will return an + the ``partition_token`` field, the API returns an ``INVALID_ARGUMENT`` error. ORDER_BY_NO_ORDER (2): Read rows are returned in any order. @@ -1427,7 +1417,8 @@ class LockHint(proto.Enum): LOCK_HINT_UNSPECIFIED (0): Default value. - LOCK_HINT_UNSPECIFIED is equivalent to LOCK_HINT_SHARED. + ``LOCK_HINT_UNSPECIFIED`` is equivalent to + ``LOCK_HINT_SHARED``. LOCK_HINT_SHARED (1): Acquire shared locks. @@ -1460,9 +1451,9 @@ class LockHint(proto.Enum): turn to acquire the lock and avoids getting into deadlock situations. - Because the exclusive lock hint is just a hint, it should - not be considered equivalent to a mutex. In other words, you - should not use Spanner exclusive locks as a mutual exclusion + Because the exclusive lock hint is just a hint, it shouldn't + be considered equivalent to a mutex. In other words, you + shouldn't use Spanner exclusive locks as a mutual exclusion mechanism for the execution of code outside of Spanner. **Note:** Request exclusive locks judiciously because they @@ -1553,19 +1544,17 @@ class BeginTransactionRequest(proto.Message): Required. Options for the new transaction. request_options (google.cloud.spanner_v1.types.RequestOptions): Common options for this request. Priority is ignored for - this request. Setting the priority in this request_options - struct will not do anything. To set the priority for a - transaction, set it on the reads and writes that are part of - this transaction instead. + this request. Setting the priority in this + ``request_options`` struct doesn't do anything. To set the + priority for a transaction, set it on the reads and writes + that are part of this transaction instead. mutation_key (google.cloud.spanner_v1.types.Mutation): Optional. Required for read-write transactions on a multiplexed session that - commit mutations but do not perform any reads or - queries. Clients should randomly select one of - the mutations from the mutation set and send it - as a part of this request. - This feature is not yet supported and will - result in an UNIMPLEMENTED error. + commit mutations but don't perform any reads or + queries. You must randomly select one of the + mutations from the mutation set and send it as a + part of this request. """ session: str = proto.Field( @@ -1613,8 +1602,8 @@ class CommitRequest(proto.Message): 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 + the transport library), it's possible that the mutations are + executed more than once. If this is undesirable, use [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction] and [Commit][google.spanner.v1.Spanner.Commit] instead. @@ -1625,29 +1614,26 @@ class CommitRequest(proto.Message): atomically, in the order they appear in this list. return_commit_stats (bool): - If ``true``, then statistics related to the transaction will - be included in the + If ``true``, then statistics related to the transaction is + included in the [CommitResponse][google.spanner.v1.CommitResponse.commit_stats]. Default value is ``false``. max_commit_delay (google.protobuf.duration_pb2.Duration): Optional. The amount of latency this request - is willing to incur in order to improve - throughput. If this field is not set, Spanner + is configured to incur in order to improve + throughput. If this field isn't set, Spanner assumes requests are relatively latency sensitive and automatically determines an - appropriate delay time. You can specify a - batching delay value between 0 and 500 ms. + appropriate delay time. You can specify a commit + delay value between 0 and 500 ms. request_options (google.cloud.spanner_v1.types.RequestOptions): Common options for this request. precommit_token (google.cloud.spanner_v1.types.MultiplexedSessionPrecommitToken): - Optional. If the read-write transaction was - executed on a multiplexed session, the precommit - token with the highest sequence number received - in this transaction attempt, should be included - here. Failing to do so will result in a - FailedPrecondition error. - This feature is not yet supported and will - result in an UNIMPLEMENTED error. + Optional. If the read-write transaction was executed on a + multiplexed session, then you must include the precommit + token with the highest sequence number received in this + transaction attempt. Failing to do so results in a + ``FailedPrecondition`` error. """ session: str = proto.Field( @@ -1725,22 +1711,11 @@ class BatchWriteRequest(proto.Message): Required. The groups of mutations to be applied. exclude_txn_from_change_streams (bool): - Optional. When ``exclude_txn_from_change_streams`` is set to - ``true``: - - - Mutations from all transactions in this batch write - operation will not be recorded in change streams with DDL - option ``allow_txn_exclusion=true`` that are tracking - columns modified by these transactions. - - Mutations from all transactions in this batch write - operation will be recorded in change streams with DDL - option ``allow_txn_exclusion=false or not set`` that are - tracking columns modified by these transactions. - - When ``exclude_txn_from_change_streams`` is set to ``false`` - or not set, mutations from all transactions in this batch - write operation will be recorded in all change streams that - are tracking columns modified by these transactions. + Optional. If you don't set the + ``exclude_txn_from_change_streams`` option or if it's set to + ``false``, then any change streams monitoring columns + modified by transactions will capture the updates made + within that transaction. """ class MutationGroup(proto.Message): diff --git a/google/cloud/spanner_v1/types/transaction.py b/google/cloud/spanner_v1/types/transaction.py index 9291501c21..447c310548 100644 --- a/google/cloud/spanner_v1/types/transaction.py +++ b/google/cloud/spanner_v1/types/transaction.py @@ -75,13 +75,13 @@ class TransactionOptions(proto.Message): it prevents read or write transactions from being tracked in change streams. - - If the DDL option ``allow_txn_exclusion`` is set to - ``true``, then the updates made within this transaction - aren't recorded in the change stream. + - If the DDL option ``allow_txn_exclusion`` is set to + ``true``, then the updates made within this transaction + aren't recorded in the change stream. - - If you don't set the DDL option ``allow_txn_exclusion`` - or if it's set to ``false``, then the updates made within - this transaction are recorded in the change stream. + - If you don't set the DDL option ``allow_txn_exclusion`` or + if it's set to ``false``, then the updates made within + this transaction are recorded in the change stream. When ``exclude_txn_from_change_streams`` is set to ``false`` or not set, modifications from this transaction are recorded @@ -106,17 +106,15 @@ class IsolationLevel(proto.Enum): If the value is not specified, the ``SERIALIZABLE`` isolation level is used. SERIALIZABLE (1): - All transactions appear as if they executed - in a serial order, even if some of the reads, - writes, and other operations of distinct - transactions actually occurred in parallel. - Spanner assigns commit timestamps that reflect - the order of committed transactions to implement - this property. Spanner offers a stronger - guarantee than serializability called external - consistency. For further details, please refer - to - https://cloud.google.com/spanner/docs/true-time-external-consistency#serializability. + All transactions appear as if they executed in a serial + order, even if some of the reads, writes, and other + operations of distinct transactions actually occurred in + parallel. Spanner assigns commit timestamps that reflect the + order of committed transactions to implement this property. + Spanner offers a stronger guarantee than serializability + called external consistency. For more information, see + `TrueTime and external + consistency `__. REPEATABLE_READ (2): All reads performed during the transaction observe a consistent snapshot of the database, and the transaction is @@ -159,22 +157,22 @@ class ReadLockMode(proto.Enum): READ_LOCK_MODE_UNSPECIFIED (0): Default value. - - If isolation level is - [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ], - then it is an error to specify ``read_lock_mode``. - Locking semantics default to ``OPTIMISTIC``. No - validation checks are done for reads, except to validate - that the data that was served at the snapshot time is - unchanged at commit time in the following cases: - - 1. reads done as part of queries that use - ``SELECT FOR UPDATE`` - 2. reads done as part of statements with a - ``LOCK_SCANNED_RANGES`` hint - 3. reads done as part of DML statements - - - At all other isolation levels, if ``read_lock_mode`` is - the default value, then pessimistic read locks are used. + - If isolation level is + [REPEATABLE_READ][google.spanner.v1.TransactionOptions.IsolationLevel.REPEATABLE_READ], + then it is an error to specify ``read_lock_mode``. Locking + semantics default to ``OPTIMISTIC``. No validation checks + are done for reads, except to validate that the data that + was served at the snapshot time is unchanged at commit + time in the following cases: + + 1. reads done as part of queries that use + ``SELECT FOR UPDATE`` + 2. reads done as part of statements with a + ``LOCK_SCANNED_RANGES`` hint + 3. reads done as part of DML statements + + - At all other isolation levels, if ``read_lock_mode`` is + the default value, then pessimistic read locks are used. PESSIMISTIC (1): Pessimistic lock mode. diff --git a/google/cloud/spanner_v1/types/type.py b/google/cloud/spanner_v1/types/type.py index 8996b67388..d6d516569e 100644 --- a/google/cloud/spanner_v1/types/type.py +++ b/google/cloud/spanner_v1/types/type.py @@ -91,12 +91,12 @@ class TypeCode(proto.Enum): 7159. The following rules are applied when parsing JSON input: - - Whitespace characters are not preserved. - - If a JSON object has duplicate keys, only the first key - is preserved. - - Members of a JSON object are not guaranteed to have their - order preserved. - - JSON array elements will have their order preserved. + - Whitespace characters are not preserved. + - If a JSON object has duplicate keys, only the first key is + preserved. + - Members of a JSON object are not guaranteed to have their + order preserved. + - JSON array elements will have their order preserved. PROTO (13): Encoded as a base64-encoded ``string``, as described in RFC 4648, section 4. diff --git a/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json b/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json index e6f99e7e7d..f6bcc86bf4 100644 --- a/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json +++ b/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-spanner-admin-database", - "version": "3.57.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json b/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json index af6c65815a..06d6291f45 100644 --- a/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json +++ b/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-spanner-admin-instance", - "version": "3.57.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.spanner.v1.json b/samples/generated_samples/snippet_metadata_google.spanner.v1.json index 0c303b9ff0..727606e51f 100644 --- a/samples/generated_samples/snippet_metadata_google.spanner.v1.json +++ b/samples/generated_samples/snippet_metadata_google.spanner.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-spanner", - "version": "3.57.0" + "version": "0.1.0" }, "snippets": [ { diff --git a/testing/constraints-3.8.txt b/testing/constraints-3.8.txt new file mode 100644 index 0000000000..ad3f0fa58e --- /dev/null +++ b/testing/constraints-3.8.txt @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +# This constraints file is required for unit tests. +# List all library dependencies and extras in this file. +google-api-core +proto-plus +protobuf +grpc-google-iam-v1 From af8e9731f0b6d1317565a4618d6614a7d48a4138 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 10:55:56 +0530 Subject: [PATCH 6/6] chore(main): release 3.58.0 (#1405) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ .../cloud/spanner_admin_database_v1/gapic_version.py | 2 +- .../cloud/spanner_admin_instance_v1/gapic_version.py | 2 +- google/cloud/spanner_v1/gapic_version.py | 2 +- ...et_metadata_google.spanner.admin.database.v1.json | 2 +- ...et_metadata_google.spanner.admin.instance.v1.json | 2 +- .../snippet_metadata_google.spanner.v1.json | 2 +- 8 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5dc714bd36..63ab47b126 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.57.0" + ".": "3.58.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index a00f09f300..2c2f33e74f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://pypi.org/project/google-cloud-spanner/#history +## [3.58.0](https://github.com/googleapis/python-spanner/compare/v3.57.0...v3.58.0) (2025-09-10) + + +### Features + +* **spanner:** Support setting read lock mode ([#1404](https://github.com/googleapis/python-spanner/issues/1404)) ([ee24c6e](https://github.com/googleapis/python-spanner/commit/ee24c6ee2643bc74d52e9f0a924b80a830fa2697)) + + +### Dependencies + +* Remove Python 3.7 and 3.8 as supported runtimes ([#1395](https://github.com/googleapis/python-spanner/issues/1395)) ([fc93792](https://github.com/googleapis/python-spanner/commit/fc9379232224f56d29d2e36559a756c05a5478ff)) + ## [3.57.0](https://github.com/googleapis/python-spanner/compare/v3.56.0...v3.57.0) (2025-08-14) diff --git a/google/cloud/spanner_admin_database_v1/gapic_version.py b/google/cloud/spanner_admin_database_v1/gapic_version.py index 5c0faa7b3e..fa3f4c040d 100644 --- a/google/cloud/spanner_admin_database_v1/gapic_version.py +++ b/google/cloud/spanner_admin_database_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.57.0" # {x-release-please-version} +__version__ = "3.58.0" # {x-release-please-version} diff --git a/google/cloud/spanner_admin_instance_v1/gapic_version.py b/google/cloud/spanner_admin_instance_v1/gapic_version.py index 5c0faa7b3e..fa3f4c040d 100644 --- a/google/cloud/spanner_admin_instance_v1/gapic_version.py +++ b/google/cloud/spanner_admin_instance_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.57.0" # {x-release-please-version} +__version__ = "3.58.0" # {x-release-please-version} diff --git a/google/cloud/spanner_v1/gapic_version.py b/google/cloud/spanner_v1/gapic_version.py index 5c0faa7b3e..fa3f4c040d 100644 --- a/google/cloud/spanner_v1/gapic_version.py +++ b/google/cloud/spanner_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "3.57.0" # {x-release-please-version} +__version__ = "3.58.0" # {x-release-please-version} diff --git a/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json b/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json index f6bcc86bf4..d10e70605f 100644 --- a/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json +++ b/samples/generated_samples/snippet_metadata_google.spanner.admin.database.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-spanner-admin-database", - "version": "0.1.0" + "version": "3.58.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json b/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json index 06d6291f45..05a040bd1b 100644 --- a/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json +++ b/samples/generated_samples/snippet_metadata_google.spanner.admin.instance.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-spanner-admin-instance", - "version": "0.1.0" + "version": "3.58.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.spanner.v1.json b/samples/generated_samples/snippet_metadata_google.spanner.v1.json index 727606e51f..1eb4c96ad5 100644 --- a/samples/generated_samples/snippet_metadata_google.spanner.v1.json +++ b/samples/generated_samples/snippet_metadata_google.spanner.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-spanner", - "version": "0.1.0" + "version": "3.58.0" }, "snippets": [ {