From 104ccd6a2b851c6c422e6bad1f6b588b113b6292 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Fri, 17 Apr 2026 06:12:00 +0000 Subject: [PATCH 1/3] chore: enable and fix generation for google-cloud-bigtable - Remove `skip_generate: true` from librarian.yaml - Use `\Z` instead of `\z` in string replacements (`\z` is only available in Python 3.14+ whereas the Librarian docker image uses Python 3.11. `\Z` means the same thing and is the simplest fix for now.) --- .../client-post-processing/bigtable-integration.yaml | 4 ++-- librarian.yaml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.librarian/generator-input/client-post-processing/bigtable-integration.yaml b/.librarian/generator-input/client-post-processing/bigtable-integration.yaml index 4ed17231fd7e..f8ebe075eef0 100644 --- a/.librarian/generator-input/client-post-processing/bigtable-integration.yaml +++ b/.librarian/generator-input/client-post-processing/bigtable-integration.yaml @@ -247,7 +247,7 @@ replacements: - paths: [ packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/__init__.py ] - before: '"UpdateTableRequest",\n\)\n\z' + before: '"UpdateTableRequest",\n\)\n\Z' after: | "UpdateTableRequest", ) @@ -259,7 +259,7 @@ replacements: - paths: [ packages/google-cloud-bigtable/google/cloud/bigtable_admin/__init__.py ] - before: '"Type",\n\)\n\z' + before: '"Type",\n\)\n\Z' after: | "Type", ) diff --git a/librarian.yaml b/librarian.yaml index 1cd2be4d5f85..a5f8acb9357c 100644 --- a/librarian.yaml +++ b/librarian.yaml @@ -1160,7 +1160,6 @@ libraries: keep: - CHANGELOG.md - docs/CHANGELOG.md - skip_generate: true python: library_type: GAPIC_COMBO opt_args_by_api: From 707edbef9a68b80b212e49f00761c20c4475d513 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Fri, 17 Apr 2026 06:13:46 +0000 Subject: [PATCH 2/3] chore: reformat google-cloud-bigtable This was performed with `nox -f format --no-install --no-venv` --- .../data/_sync_autogen/_mutate_rows.py | 5 ++- .../bigtable/data/_sync_autogen/_read_rows.py | 3 ++ .../data/_sync_autogen/_swappable_channel.py | 5 +-- .../bigtable/data/_sync_autogen/client.py | 31 ++++++++++--------- .../data/_sync_autogen/metrics_interceptor.py | 5 ++- .../data/_sync_autogen/mutations_batcher.py | 4 ++- .../_sync_autogen/execute_query_iterator.py | 3 ++ .../admin_overlay/test_system_autogen.py | 5 ++- .../tests/system/data/test_system_autogen.py | 5 ++- .../data/_sync_autogen/test__mutate_rows.py | 3 ++ .../data/_sync_autogen/test__read_rows.py | 1 + .../_sync_autogen/test__swappable_channel.py | 1 + .../unit/data/_sync_autogen/test_client.py | 21 +++++++++---- .../_sync_autogen/test_metrics_interceptor.py | 1 + .../_sync_autogen/test_mutations_batcher.py | 3 ++ .../test_read_rows_acceptance.py | 4 +++ .../_sync_autogen/test_query_iterator.py | 3 ++ 17 files changed, 75 insertions(+), 28 deletions(-) diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py index fad8e2469ecb..c1c508a526f2 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py @@ -16,9 +16,12 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + from typing import TYPE_CHECKING, Sequence + from google.api_core import exceptions as core_exceptions from google.api_core import retry as retries + import google.cloud.bigtable.data.exceptions as bt_exceptions import google.cloud.bigtable_v2.types.bigtable as types_pb from google.cloud.bigtable.data._cross_sync import CrossSync @@ -32,10 +35,10 @@ ) if TYPE_CHECKING: - from google.cloud.bigtable.data.mutations import RowMutationEntry from google.cloud.bigtable.data._sync_autogen.client import ( _DataApiTarget as TargetType, ) + from google.cloud.bigtable.data.mutations import RowMutationEntry from google.cloud.bigtable_v2.services.bigtable.client import ( BigtableClient as GapicClientType, ) diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_read_rows.py b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_read_rows.py index 9ccde8b07761..a74374988161 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_read_rows.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_read_rows.py @@ -17,9 +17,12 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + from typing import TYPE_CHECKING, Sequence + from google.api_core import retry as retries from google.api_core.retry import exponential_sleep_generator + from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data._helpers import ( _attempt_timeout_generator, diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_swappable_channel.py b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_swappable_channel.py index 78ba129d98c5..93f2b44a6df6 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_swappable_channel.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/_swappable_channel.py @@ -16,9 +16,10 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + from typing import Callable -from grpc import ChannelConnectivity -from grpc import Channel + +from grpc import Channel, ChannelConnectivity class _WrappedChannel(Channel): diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/client.py b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/client.py index a5873ecc0931..35da990c92b8 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/client.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/client.py @@ -17,6 +17,7 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + import abc import concurrent.futures import os @@ -24,7 +25,8 @@ import time import warnings from functools import partial -from typing import TYPE_CHECKING, Any, Callable, Optional, Sequence, Set, cast +from typing import TYPE_CHECKING, Any, Callable, Iterable, Optional, Sequence, Set, cast + import google.auth._default import google.auth.credentials from google.api_core import client_options as client_options_lib @@ -39,7 +41,8 @@ from google.cloud.environment_vars import BIGTABLE_EMULATOR from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper from google.protobuf.message import Message -from grpc import Channel +from grpc import Channel, insecure_channel, intercept_channel + from google.cloud.bigtable.client import _DEFAULT_BIGTABLE_EMULATOR_CLIENT from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data._helpers import ( @@ -55,6 +58,13 @@ _WarmedInstanceKey, ) from google.cloud.bigtable.data._metrics import BigtableClientSideMetricsController +from google.cloud.bigtable.data._sync_autogen._swappable_channel import ( + SwappableChannel as SwappableChannelType, +) +from google.cloud.bigtable.data._sync_autogen.metrics_interceptor import ( + BigtableMetricsInterceptor as MetricsInterceptorType, +) +from google.cloud.bigtable.data._sync_autogen.mutations_batcher import _MB_SIZE from google.cloud.bigtable.data.exceptions import ( FailedQueryShardError, ShardedReadRowsExceptionGroup, @@ -78,6 +88,10 @@ RowFilterChain, StripValueTransformerFilter, ) +from google.cloud.bigtable_v2.services.bigtable import BigtableClient as GapicClient +from google.cloud.bigtable_v2.services.bigtable.transports import ( + BigtableGrpcTransport as TransportType, +) from google.cloud.bigtable_v2.services.bigtable.transports.base import ( DEFAULT_CLIENT_INFO, ) @@ -88,19 +102,6 @@ ReadModifyWriteRowRequest, SampleRowKeysRequest, ) -from typing import Iterable -from grpc import insecure_channel, intercept_channel -from google.cloud.bigtable.data._sync_autogen._swappable_channel import ( - SwappableChannel as SwappableChannelType, -) -from google.cloud.bigtable.data._sync_autogen.metrics_interceptor import ( - BigtableMetricsInterceptor as MetricsInterceptorType, -) -from google.cloud.bigtable.data._sync_autogen.mutations_batcher import _MB_SIZE -from google.cloud.bigtable_v2.services.bigtable import BigtableClient as GapicClient -from google.cloud.bigtable_v2.services.bigtable.transports import ( - BigtableGrpcTransport as TransportType, -) if TYPE_CHECKING: from google.cloud.bigtable.data._helpers import RowKeySamples, ShardedQuery diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/metrics_interceptor.py b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/metrics_interceptor.py index fc60c6e4e89b..4347cfa61bc1 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/metrics_interceptor.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/metrics_interceptor.py @@ -15,15 +15,18 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + import time from functools import wraps from typing import Sequence + +from grpc import UnaryStreamClientInterceptor, UnaryUnaryClientInterceptor + from google.cloud.bigtable.data._metrics.data_model import ( ActiveOperationMetric, OperationState, OperationType, ) -from grpc import UnaryStreamClientInterceptor, UnaryUnaryClientInterceptor def _with_active_operation(func): diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py index 41952f73ba98..176f3105e136 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py @@ -16,11 +16,13 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + import atexit import concurrent.futures import warnings from collections import deque from typing import TYPE_CHECKING, Sequence, cast + from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data._helpers import ( TABLE_DEFAULT, @@ -37,10 +39,10 @@ ) if TYPE_CHECKING: - from google.cloud.bigtable.data.mutations import RowMutationEntry from google.cloud.bigtable.data._sync_autogen.client import ( _DataApiTarget as TargetType, ) + from google.cloud.bigtable.data.mutations import RowMutationEntry _MB_SIZE = 1024 * 1024 diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py b/packages/google-cloud-bigtable/google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py index d00457724eb5..e023da6cefb1 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py @@ -16,10 +16,13 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Tuple + from google.api_core import retry as retries from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper from google.protobuf.message import Message + from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data._helpers import ( _attempt_timeout_generator, diff --git a/packages/google-cloud-bigtable/tests/system/admin_overlay/test_system_autogen.py b/packages/google-cloud-bigtable/tests/system/admin_overlay/test_system_autogen.py index d791da75ab13..ed5fc637fb05 100644 --- a/packages/google-cloud-bigtable/tests/system/admin_overlay/test_system_autogen.py +++ b/packages/google-cloud-bigtable/tests/system/admin_overlay/test_system_autogen.py @@ -18,11 +18,15 @@ import os from datetime import datetime, timedelta from typing import Tuple + import pytest +from google.api_core import operation as api_core_operation from google.cloud.environment_vars import BIGTABLE_EMULATOR + from google.cloud import bigtable_admin_v2 as admin_v2 from google.cloud.bigtable.data import mutations, read_rows_query from google.cloud.bigtable.data._cross_sync import CrossSync + from .conftest import ( BACKUP_PREFIX, DEFAULT_CLUSTER_LOCATIONS, @@ -38,7 +42,6 @@ TEST_TABLE_NAME, generate_unique_suffix, ) -from google.api_core import operation as api_core_operation if os.getenv(BIGTABLE_EMULATOR): pytest.skip( diff --git a/packages/google-cloud-bigtable/tests/system/data/test_system_autogen.py b/packages/google-cloud-bigtable/tests/system/data/test_system_autogen.py index 396f7b1a0605..a324c514be28 100644 --- a/packages/google-cloud-bigtable/tests/system/data/test_system_autogen.py +++ b/packages/google-cloud-bigtable/tests/system/data/test_system_autogen.py @@ -18,19 +18,22 @@ import datetime import os import uuid + import pytest from google.api_core import retry from google.api_core.exceptions import ClientError, PermissionDenied from google.cloud.environment_vars import BIGTABLE_EMULATOR from google.type import date_pb2 + from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data.execute_query.metadata import SqlType from google.cloud.bigtable.data.read_modify_write_rules import _MAX_INCREMENT_VALUE -from . import TEST_AGGREGATE_FAMILY, TEST_FAMILY, TEST_FAMILY_2 from google.cloud.bigtable_v2.services.bigtable.transports.grpc import ( _LoggingClientInterceptor as GapicInterceptor, ) +from . import TEST_AGGREGATE_FAMILY, TEST_FAMILY, TEST_FAMILY_2 + TARGETS = ["table"] if not os.environ.get(BIGTABLE_EMULATOR): TARGETS.append("authorized_view") diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__mutate_rows.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__mutate_rows.py index a9c841399098..3bce82f1e50f 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__mutate_rows.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__mutate_rows.py @@ -18,6 +18,7 @@ import pytest from google.api_core.exceptions import DeadlineExceeded, Forbidden from google.rpc import status_pb2 + from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data.mutations import DeleteAllFromRow, RowMutationEntry from google.cloud.bigtable_v2.types import MutateRowsResponse @@ -73,6 +74,7 @@ def _make_mock_gapic(self, mutation_list, error_dict=None): def test_ctor(self): """test that constructor sets all the attributes correctly""" from google.api_core.exceptions import Aborted, DeadlineExceeded + from google.cloud.bigtable.data._async._mutate_rows import _EntryWithProto from google.cloud.bigtable.data.exceptions import _MutateRowsIncomplete @@ -223,6 +225,7 @@ def test_mutate_rows_exception_retryable_eventually_pass(self, exc_type): def test_mutate_rows_incomplete_ignored(self): """MutateRowsIncomplete exceptions should not be added to error list""" from google.api_core.exceptions import DeadlineExceeded + from google.cloud.bigtable.data.exceptions import ( MutationsExceptionGroup, _MutateRowsIncomplete, diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__read_rows.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__read_rows.py index eb0343dd4a20..f16a523e862d 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__read_rows.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__read_rows.py @@ -16,6 +16,7 @@ # This file is automatically generated by CrossSync. Do not edit manually. import pytest + from google.cloud.bigtable.data._cross_sync import CrossSync try: diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__swappable_channel.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__swappable_channel.py index 04f3f61c8d86..25429bdc8a28 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__swappable_channel.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test__swappable_channel.py @@ -22,6 +22,7 @@ import mock import pytest from grpc import ChannelConnectivity + from google.cloud.bigtable.data._sync_autogen._swappable_channel import ( SwappableChannel as TargetType, ) diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py index 0d5e47b1072b..b18ee6fdd8b7 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_client.py @@ -15,16 +15,23 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + import asyncio import re + import grpc import mock import pytest -from google.api_core import client_options +from google.api_core import client_options, grpc_helpers from google.api_core import exceptions as core_exceptions from google.auth.credentials import AnonymousCredentials + from google.cloud.bigtable.data import TABLE_DEFAULT, mutations from google.cloud.bigtable.data._cross_sync import CrossSync +from google.cloud.bigtable.data._sync_autogen._swappable_channel import SwappableChannel +from google.cloud.bigtable.data._sync_autogen.metrics_interceptor import ( + BigtableMetricsInterceptor, +) from google.cloud.bigtable.data.exceptions import InvalidChunk, _MutateRowsIncomplete from google.cloud.bigtable.data.mutations import DeleteAllFromRow from google.cloud.bigtable.data.read_modify_write_rules import ( @@ -45,11 +52,6 @@ str_type, str_val, ) -from google.api_core import grpc_helpers -from google.cloud.bigtable.data._sync_autogen._swappable_channel import SwappableChannel -from google.cloud.bigtable.data._sync_autogen.metrics_interceptor import ( - BigtableMetricsInterceptor, -) CrossSync._Sync_Impl.add_mapping("grpc_helpers", grpc_helpers) CrossSync._Sync_Impl.add_mapping("SwappableChannel", SwappableChannel) @@ -749,6 +751,7 @@ def test_api_surface_arg_passthrough(self, method): def test_api_surface_context_manager(self, method): """get_table and get_authorized_view should work as context managers""" from functools import partial + from google.cloud.bigtable.data._helpers import _WarmedInstanceKey expected_table_id = "table-id" @@ -1886,6 +1889,7 @@ def test_read_rows_sharded_expirary(self): """If the operation times out before all shards complete, should raise a ShardedReadRowsExceptionGroup""" from google.api_core.exceptions import DeadlineExceeded + from google.cloud.bigtable.data._helpers import _CONCURRENCY_LIMIT from google.cloud.bigtable.data.exceptions import ShardedReadRowsExceptionGroup @@ -1921,6 +1925,7 @@ def test_read_rows_sharded_negative_batch_timeout(self): They should raise DeadlineExceeded errors""" from google.api_core.exceptions import DeadlineExceeded + from google.cloud.bigtable.data._helpers import _CONCURRENCY_LIMIT from google.cloud.bigtable.data.exceptions import ShardedReadRowsExceptionGroup @@ -2042,6 +2047,7 @@ def test_sample_row_keys_gapic_params(self): def test_sample_row_keys_retryable_errors(self, retryable_exception): """retryable errors should be retried until timeout""" from google.api_core.exceptions import DeadlineExceeded + from google.cloud.bigtable.data.exceptions import RetryExceptionGroup with self._make_client() as client: @@ -2142,6 +2148,7 @@ def test_mutate_row(self, mutation_arg): ) def test_mutate_row_retryable_errors(self, retryable_exception): from google.api_core.exceptions import DeadlineExceeded + from google.cloud.bigtable.data.exceptions import RetryExceptionGroup with self._make_client(project="project") as client: @@ -2220,6 +2227,7 @@ def _make_client(self, *args, **kwargs): def _mock_response(self, response_list): from google.rpc import status_pb2 + from google.cloud.bigtable_v2.types import MutateRowsResponse statuses = [] @@ -2491,6 +2499,7 @@ def test_bulk_mutate_error_index(self): FailedPrecondition, ServiceUnavailable, ) + from google.cloud.bigtable.data.exceptions import ( FailedMutationEntryError, MutationsExceptionGroup, diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_metrics_interceptor.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_metrics_interceptor.py index e89108e12bc6..20d7a62646dd 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_metrics_interceptor.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_metrics_interceptor.py @@ -17,6 +17,7 @@ import pytest from grpc import ClientCallDetails, RpcError + from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data._metrics.data_model import ( ActiveOperationMetric, diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_mutations_batcher.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_mutations_batcher.py index 9f5bec2efb82..4e96513076bc 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_mutations_batcher.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_mutations_batcher.py @@ -17,10 +17,12 @@ import asyncio import time + import google.api_core.exceptions as core_exceptions import google.api_core.retry import mock import pytest + from google.cloud.bigtable.data import TABLE_DEFAULT from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data.exceptions import _MutateRowsIncomplete @@ -769,6 +771,7 @@ def gen(x): def _mock_gapic_return(self, num=5): from google.rpc import status_pb2 + from google.cloud.bigtable_v2.types import MutateRowsResponse def gen(num): diff --git a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_read_rows_acceptance.py b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_read_rows_acceptance.py index 0950576645e8..29332e712d35 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_read_rows_acceptance.py +++ b/packages/google-cloud-bigtable/tests/unit/data/_sync_autogen/test_read_rows_acceptance.py @@ -15,15 +15,19 @@ # This file is automatically generated by CrossSync. Do not edit manually. from __future__ import annotations + import os import warnings from itertools import zip_longest + import mock import pytest + from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data.exceptions import InvalidChunk from google.cloud.bigtable.data.row import Row from google.cloud.bigtable_v2 import ReadRowsResponse + from ...v2_client.test_row_merger import ReadRowsTest, TestFile diff --git a/packages/google-cloud-bigtable/tests/unit/data/execute_query/_sync_autogen/test_query_iterator.py b/packages/google-cloud-bigtable/tests/unit/data/execute_query/_sync_autogen/test_query_iterator.py index 25666e8b9d3b..7c3efce32126 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/execute_query/_sync_autogen/test_query_iterator.py +++ b/packages/google-cloud-bigtable/tests/unit/data/execute_query/_sync_autogen/test_query_iterator.py @@ -17,12 +17,15 @@ import concurrent.futures import gc + import pytest + from google.cloud.bigtable.data import exceptions from google.cloud.bigtable.data._cross_sync import CrossSync from google.cloud.bigtable.data.execute_query.metadata import ( _pb_metadata_to_metadata_types, ) + from ..sql_helpers import chunked_responses, column, int64_type, int_val, metadata try: From 6697c1eb1838d3f0ed4f7a32ea211a0a839a190e Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Fri, 17 Apr 2026 06:15:34 +0000 Subject: [PATCH 3/3] chore: regenerate with librarian --- .../google-cloud-bigtable/.repo-metadata.json | 85 +++---------------- .../docs/classic_client/snippets.py | 54 +++++------- .../docs/classic_client/snippets_table.py | 49 ++++------- .../docs/scripts/patch_devsite_toc.py | 12 +-- .../cloud/bigtable_admin_v2/types/table.py | 22 +++-- .../test_proxy/protos/bigtable_pb2.py | 15 ++++ .../test_proxy/protos/data_pb2.py | 15 ++++ .../test_proxy/protos/request_stats_pb2.py | 15 ++++ .../test_proxy/protos/test_proxy_pb2.py | 15 ++++ .../test_proxy/protos/types_pb2.py | 15 ++++ .../execute_query/resources/singer_pb2.py | 15 ++++ .../test_bigtable_table_admin.py | 6 +- 12 files changed, 165 insertions(+), 153 deletions(-) diff --git a/packages/google-cloud-bigtable/.repo-metadata.json b/packages/google-cloud-bigtable/.repo-metadata.json index 011989a371e5..c5949faf170d 100644 --- a/packages/google-cloud-bigtable/.repo-metadata.json +++ b/packages/google-cloud-bigtable/.repo-metadata.json @@ -1,81 +1,16 @@ { - "name": "bigtable", - "name_pretty": "Google Cloud Bigtable", "api_description": "is Google's NoSQL Big Data database service. It's the\nsame database that powers many core Google services, including Search,\nAnalytics, Maps, and Gmail.", - "product_documentation": "https://cloud.google.com/bigtable", + "api_id": "bigtable.googleapis.com", + "api_shortname": "bigtable", "client_documentation": "https://cloud.google.com/python/docs/reference/bigtable/latest", + "default_version": "v2", + "distribution_name": "google-cloud-bigtable", "issue_tracker": "https://issuetracker.google.com/savedsearches/559777", - "release_level": "stable", "language": "python", "library_type": "GAPIC_COMBO", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-bigtable", - "api_id": "bigtable.googleapis.com", - "requires_billing": true, - "samples": [ - { - "name": "Hello World in Cloud Bigtable", - "description": "Demonstrates how to connect to Cloud Bigtable and run some basic operations. More information available at: https://cloud.google.com/bigtable/docs/samples-python-hello", - "file": "main.py", - "runnable": true, - "custom_content": "
usage: main.py [-h] [--table TABLE] project_id instance_id
Demonstrates how to connect to Cloud Bigtable and run some basic operations.
Prerequisites: - Create a Cloud Bigtable cluster.
https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google
Application Default Credentials.
https://developers.google.com/identity/protocols/application-default-
credentials


positional arguments:
  project_id     Your Cloud Platform project ID.
  instance_id    ID of the Cloud Bigtable instance to connect to.


optional arguments:
  -h, --help     show this help message and exit
  --table TABLE  Table to create and destroy. (default: Hello-Bigtable)
", - "override_path": "hello" - }, - { - "name": "Hello World using HappyBase", - "description": "This sample demonstrates using the Google Cloud Client Library HappyBase package, an implementation of the HappyBase API to connect to and interact with Cloud Bigtable. More information available at: https://cloud.google.com/bigtable/docs/samples-python-hello-happybase", - "file": "main.py", - "runnable": true, - "custom_content": "
usage: main.py [-h] [--table TABLE] project_id instance_id
Demonstrates how to connect to Cloud Bigtable and run some basic operations.
Prerequisites: - Create a Cloud Bigtable cluster.
https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google
Application Default Credentials.
https://developers.google.com/identity/protocols/application-default-
credentials


positional arguments:
  project_id     Your Cloud Platform project ID.
  instance_id    ID of the Cloud Bigtable instance to connect to.


optional arguments:
  -h, --help     show this help message and exit
  --table TABLE  Table to create and destroy. (default: Hello-Bigtable)
", - "override_path": "hello_happybase" - }, - { - "name": "cbt Command Demonstration", - "description": "This page explains how to use the cbt command to connect to a Cloud Bigtable instance, perform basic administrative tasks, and read and write data in a table. More information about this quickstart is available at https://cloud.google.com/bigtable/docs/quickstart-cbt", - "file": "instanceadmin.py", - "runnable": true, - "custom_content": "
usage: instanceadmin.py [-h] [run] [dev-instance] [del-instance] [add-cluster] [del-cluster] project_id instance_id cluster_id
Demonstrates how to connect to Cloud Bigtable and run some basic operations.
Prerequisites: - Create a Cloud Bigtable cluster.
https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google
Application Default Credentials.
https://developers.google.com/identity/protocols/application-default-
credentials


positional arguments:
  project_id     Your Cloud Platform project ID.
  instance_id    ID of the Cloud Bigtable instance to connect to.


optional arguments:
  -h, --help     show this help message and exit
  --table TABLE  Table to create and destroy. (default: Hello-Bigtable)
", - "override_path": "instanceadmin" - }, - { - "name": "Metric Scaler", - "description": "This sample demonstrates how to use Stackdriver Monitoring to scale Cloud Bigtable based on CPU usage.", - "file": "metricscaler.py", - "runnable": true, - "custom_content": "
usage: metricscaler.py [-h] [--high_cpu_threshold HIGH_CPU_THRESHOLD] [--low_cpu_threshold LOW_CPU_THRESHOLD] [--short_sleep SHORT_SLEEP] [--long_sleep LONG_SLEEP] bigtable_instance bigtable_cluster
usage: metricscaler.py [-h] [--high_cpu_threshold HIGH_CPU_THRESHOLD]
                       [--low_cpu_threshold LOW_CPU_THRESHOLD]
                       [--short_sleep SHORT_SLEEP] [--long_sleep LONG_SLEEP]
                       bigtable_instance bigtable_cluster


Scales Cloud Bigtable clusters based on CPU usage.


positional arguments:
  bigtable_instance     ID of the Cloud Bigtable instance to connect to.
  bigtable_cluster      ID of the Cloud Bigtable cluster to connect to.


optional arguments:
  -h, --help            show this help message and exit
  --high_cpu_threshold HIGH_CPU_THRESHOLD
                        If Cloud Bigtable CPU usage is above this threshold,
                        scale up
  --low_cpu_threshold LOW_CPU_THRESHOLD
                        If Cloud Bigtable CPU usage is below this threshold,
                        scale down
  --short_sleep SHORT_SLEEP
                        How long to sleep in seconds between checking metrics
                        after no scale operation
  --long_sleep LONG_SLEEP
                        How long to sleep in seconds between checking metrics
                        after a scaling operation
", - "override_path": "metricscaler" - }, - { - "name": "Quickstart", - "description": "Demonstrates of Cloud Bigtable. This sample creates a Bigtable client, connects to an instance and then to a table, then closes the connection.", - "file": "main.py", - "runnable": true, - "custom_content": "
usage: main.py [-h] [--table TABLE] project_id instance_id 


positional arguments:
  project_id     Your Cloud Platform project ID.
  instance_id    ID of the Cloud Bigtable instance to connect to.


optional arguments:
  -h, --help     show this help message and exit
  --table TABLE  Existing table used in the quickstart. (default: my-table)
", - "override_path": "quickstart" - }, - { - "name": "Quickstart using HappyBase", - "description": "Demonstrates of Cloud Bigtable using HappyBase. This sample creates a Bigtable client, connects to an instance and then to a table, then closes the connection.", - "file": "main.py", - "runnable": true, - "custom_content": "
usage: main.py [-h] [--table TABLE] project_id instance_id
usage: main.py [-h] [--table TABLE] project_id instance_id


positional arguments:
  project_id     Your Cloud Platform project ID.
  instance_id    ID of the Cloud Bigtable instance to connect to.


optional arguments:
  -h, --help     show this help message and exit
  --table TABLE  Existing table used in the quickstart. (default: my-table)
", - "override_path": "quickstart_happybase" - }, - { - "name": "Snippets", - "description": "This folder contains snippets for Python Cloud Bigtable.", - "override_path": "snippets" - }, - { - "name": "Table Admin", - "description": "Demonstrates how to connect to Cloud Bigtable and run some basic operations.", - "file": "tableadmin.py", - "runnable": true, - "custom_content": "
usage: tableadmin.py [-h] [run] [delete] [--table TABLE] project_id instance_id 


Demonstrates how to connect to Cloud Bigtable and run some basic operations.
Prerequisites: - Create a Cloud Bigtable cluster.
https://cloud.google.com/bigtable/docs/creating-cluster - Set your Google
Application Default Credentials.
https://developers.google.com/identity/protocols/application-default-
credentials


positional arguments:
  project_id     Your Cloud Platform project ID.
  instance_id    ID of the Cloud Bigtable instance to connect to.


optional arguments:
  -h, --help     show this help message and exit
  --table TABLE  Table to create and destroy. (default: Hello-Bigtable)
", - "override_path": "tableadmin" - } - ], - "default_version": "v2", - "codeowner_team": "@googleapis/api-bigtable @googleapis/api-bigtable-partners", - "api_shortname": "bigtable" -} + "name": "bigtable", + "name_pretty": "Google Cloud Bigtable", + "product_documentation": "https://cloud.google.com/bigtable", + "release_level": "stable", + "repo": "googleapis/google-cloud-python" +} \ No newline at end of file diff --git a/packages/google-cloud-bigtable/docs/classic_client/snippets.py b/packages/google-cloud-bigtable/docs/classic_client/snippets.py index c6059409dd3c..3f35e0cf536c 100644 --- a/packages/google-cloud-bigtable/docs/classic_client/snippets.py +++ b/packages/google-cloud-bigtable/docs/classic_client/snippets.py @@ -30,19 +30,18 @@ """ from datetime import datetime, timezone -import pytest -from google.api_core.exceptions import DeadlineExceeded -from google.api_core.exceptions import NotFound -from google.api_core.exceptions import TooManyRequests -from google.api_core.exceptions import ServiceUnavailable -from test_utils.system import unique_resource_id +import pytest +from google.api_core.exceptions import ( + DeadlineExceeded, + NotFound, + ServiceUnavailable, + TooManyRequests, +) from test_utils.retry import RetryErrors +from test_utils.system import unique_resource_id - -from google.cloud.bigtable import Client -from google.cloud.bigtable import enums - +from google.cloud.bigtable import Client, enums UNIQUE_SUFFIX = unique_resource_id("-") INSTANCE_ID = "snippet-tests" + UNIQUE_SUFFIX @@ -57,9 +56,7 @@ STORAGE_TYPE = enums.StorageType.SSD LABEL_KEY = "python-snippet" LABEL_STAMP = ( - datetime.now(timezone.utc) - .replace(microsecond=0) - .strftime("%Y-%m-%dt%H-%M-%S") + datetime.now(timezone.utc).replace(microsecond=0).strftime("%Y-%m-%dt%H-%M-%S") ) LABELS = {LABEL_KEY: str(LABEL_STAMP)} INSTANCES_TO_DELETE = [] @@ -110,8 +107,7 @@ def teardown_module(): def test_bigtable_create_instance(): # [START bigtable_api_create_prod_instance] - from google.cloud.bigtable import Client - from google.cloud.bigtable import enums + from google.cloud.bigtable import Client, enums my_instance_id = "inst-my-" + UNIQUE_SUFFIX my_cluster_id = "clus-my-" + UNIQUE_SUFFIX @@ -144,8 +140,7 @@ def test_bigtable_create_instance(): def test_bigtable_create_additional_cluster(): # [START bigtable_api_create_cluster] - from google.cloud.bigtable import Client - from google.cloud.bigtable import enums + from google.cloud.bigtable import Client, enums # Assuming that there is an existing instance with `INSTANCE_ID` # on the server already. @@ -181,8 +176,7 @@ def test_bigtable_create_reload_delete_app_profile(): import re # [START bigtable_api_create_app_profile] - from google.cloud.bigtable import Client - from google.cloud.bigtable import enums + from google.cloud.bigtable import Client, enums routing_policy_type = enums.RoutingPolicyType.ANY @@ -422,10 +416,9 @@ def test_bigtable_cluster_disable_autoscaling(): def test_bigtable_create_table(): # [START bigtable_api_create_table] - from google.api_core import exceptions - from google.api_core import retry - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.api_core import exceptions, retry + + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -547,8 +540,7 @@ def test_bigtable_set_iam_policy_then_get_iam_policy(): # [START bigtable_api_set_iam_policy] from google.cloud.bigtable import Client - from google.cloud.bigtable.policy import Policy - from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE + from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE, Policy client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -615,8 +607,7 @@ def test_bigtable_admins_policy(): # [START bigtable_api_admins_policy] from google.cloud.bigtable import Client - from google.cloud.bigtable.policy import Policy - from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE + from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE, Policy client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -636,8 +627,7 @@ def test_bigtable_readers_policy(): # [START bigtable_api_readers_policy] from google.cloud.bigtable import Client - from google.cloud.bigtable.policy import Policy - from google.cloud.bigtable.policy import BIGTABLE_READER_ROLE + from google.cloud.bigtable.policy import BIGTABLE_READER_ROLE, Policy client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -657,8 +647,7 @@ def test_bigtable_users_policy(): # [START bigtable_api_users_policy] from google.cloud.bigtable import Client - from google.cloud.bigtable.policy import Policy - from google.cloud.bigtable.policy import BIGTABLE_USER_ROLE + from google.cloud.bigtable.policy import BIGTABLE_USER_ROLE, Policy client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -678,8 +667,7 @@ def test_bigtable_viewers_policy(): # [START bigtable_api_viewers_policy] from google.cloud.bigtable import Client - from google.cloud.bigtable.policy import Policy - from google.cloud.bigtable.policy import BIGTABLE_VIEWER_ROLE + from google.cloud.bigtable.policy import BIGTABLE_VIEWER_ROLE, Policy client = Client(admin=True) instance = client.instance(INSTANCE_ID) diff --git a/packages/google-cloud-bigtable/docs/classic_client/snippets_table.py b/packages/google-cloud-bigtable/docs/classic_client/snippets_table.py index 1850e836ba73..34b0255e300f 100644 --- a/packages/google-cloud-bigtable/docs/classic_client/snippets_table.py +++ b/packages/google-cloud-bigtable/docs/classic_client/snippets_table.py @@ -30,17 +30,13 @@ """ from datetime import datetime, timezone -import pytest -from google.api_core.exceptions import TooManyRequests -from google.api_core.exceptions import ServiceUnavailable -from test_utils.system import unique_resource_id +import pytest +from google.api_core.exceptions import ServiceUnavailable, TooManyRequests from test_utils.retry import RetryErrors +from test_utils.system import unique_resource_id -from google.cloud.bigtable import Client -from google.cloud.bigtable import enums -from google.cloud.bigtable import column_family - +from google.cloud.bigtable import Client, column_family, enums INSTANCE_ID = "snippet" + unique_resource_id("-") CLUSTER_ID = "clus-1" + unique_resource_id("-") @@ -53,9 +49,7 @@ STORAGE_TYPE = enums.StorageType.SSD LABEL_KEY = "python-snippet" LABEL_STAMP = ( - datetime.now(timezone.utc) - .replace(microsecond=0) - .strftime("%Y-%m-%dt%H-%M-%S") + datetime.now(timezone.utc).replace(microsecond=0).strftime("%Y-%m-%dt%H-%M-%S") ) LABELS = {LABEL_KEY: str(LABEL_STAMP)} COLUMN_FAMILY_ID = "col_fam_id1" @@ -112,8 +106,7 @@ def teardown_module(): def test_bigtable_create_table(): # [START bigtable_api_create_table] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -392,8 +385,7 @@ def test_bigtable_table_set_iam_policy_then_get_iam_policy(): # [START bigtable_api_table_set_iam_policy] from google.cloud.bigtable import Client - from google.cloud.bigtable.policy import Policy - from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE + from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE, Policy client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -580,8 +572,7 @@ def test_bigtable_column_family_name(): def test_bigtable_create_update_delete_column_family(): # [START bigtable_api_create_column_family] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -597,8 +588,7 @@ def test_bigtable_create_update_delete_column_family(): assert column_families[column_family_id].gc_rule == gc_rule # [START bigtable_api_update_column_family] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -616,8 +606,7 @@ def test_bigtable_create_update_delete_column_family(): assert updated_families[column_family_id].gc_rule == max_age_rule # [START bigtable_api_delete_column_family] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -670,8 +659,7 @@ def test_bigtable_add_row_add_row_range_add_row_range_from_keys(): # [START bigtable_api_add_row_range] from google.cloud.bigtable import Client - from google.cloud.bigtable.row_set import RowSet - from google.cloud.bigtable.row_set import RowRange + from google.cloud.bigtable.row_set import RowRange, RowSet client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -828,8 +816,7 @@ def test_bigtable_batcher_mutate_flush_mutate_rows(): def test_bigtable_create_family_gc_max_age(): # [START bigtable_api_create_family_gc_max_age] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -850,8 +837,7 @@ def test_bigtable_create_family_gc_max_age(): def test_bigtable_create_family_gc_max_versions(): # [START bigtable_api_create_family_gc_max_versions] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -871,8 +857,7 @@ def test_bigtable_create_family_gc_max_versions(): def test_bigtable_create_family_gc_union(): # [START bigtable_api_create_family_gc_union] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -897,8 +882,7 @@ def test_bigtable_create_family_gc_union(): def test_bigtable_create_family_gc_intersection(): # [START bigtable_api_create_family_gc_intersection] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) @@ -926,8 +910,7 @@ def test_bigtable_create_family_gc_intersection(): def test_bigtable_create_family_gc_nested(): # [START bigtable_api_create_family_gc_nested] - from google.cloud.bigtable import Client - from google.cloud.bigtable import column_family + from google.cloud.bigtable import Client, column_family client = Client(admin=True) instance = client.instance(INSTANCE_ID) diff --git a/packages/google-cloud-bigtable/docs/scripts/patch_devsite_toc.py b/packages/google-cloud-bigtable/docs/scripts/patch_devsite_toc.py index fbb753daf6ac..27fbd0cca7aa 100644 --- a/packages/google-cloud-bigtable/docs/scripts/patch_devsite_toc.py +++ b/packages/google-cloud-bigtable/docs/scripts/patch_devsite_toc.py @@ -12,19 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. """ -This script will run after ``nox -s docfx`` is run. docfx is the api doc format used by +This script will run after ``nox -s docfx`` is run. docfx is the api doc format used by google cloud. It is described here: https://github.com/googleapis/docuploader?tab=readme-ov-file#requirements-for-docfx-yaml-tarballs. One of the file used by docfx is toc.yml which is used to generate the table of contents sidebar. This script will patch file to create subfolders for each of the clients """ - import glob -import yaml import os import shutil +import yaml + # set working directory to /docs os.chdir(f"{os.path.dirname(os.path.abspath(__file__))}/{os.pardir}") @@ -234,9 +234,9 @@ def validate_toc(toc_file_path, expected_section_list, added_sections): current_toc = yaml.safe_load(open(toc_file_path, "r")) # make sure the set of sections matches what we expect found_sections = [d["name"] for d in current_toc[0]["items"]] - assert ( - found_sections == expected_section_list - ), f"Expected {expected_section_list}, found {found_sections}" + assert found_sections == expected_section_list, ( + f"Expected {expected_section_list}, found {found_sections}" + ) # make sure each customs ection is in the toc for section in added_sections: assert section.title in found_sections diff --git a/packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/types/table.py b/packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/types/table.py index 66e1626f95e3..40ad674082e1 100644 --- a/packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/types/table.py +++ b/packages/google-cloud-bigtable/google/cloud/bigtable_admin_v2/types/table.py @@ -355,12 +355,20 @@ class AutomatedBackupPolicy(proto.Message): Attributes: retention_period (google.protobuf.duration_pb2.Duration): Required. How long the automated backups - should be retained. The only supported value at - this time is 3 days. + should be retained. Values must be at least 3 + days and at most 90 days. frequency (google.protobuf.duration_pb2.Duration): - Required. How frequently automated backups - should occur. The only supported value at this - time is 24 hours. + How frequently automated backups should + occur. The only supported value at this time is + 24 hours. An undefined frequency is treated as + 24 hours. + locations (MutableSequence[str]): + Optional. A list of Cloud Bigtable zones where automated + backups are allowed to be created. If empty, automated + backups will be created in all zones of the instance. + Locations are in the format + ``projects/{project}/locations/{zone}``. This field can only + set for tables in Enterprise Plus instances. """ retention_period: duration_pb2.Duration = proto.Field( @@ -373,6 +381,10 @@ class AutomatedBackupPolicy(proto.Message): number=2, message=duration_pb2.Duration, ) + locations: MutableSequence[str] = proto.RepeatedField( + proto.STRING, + number=3, + ) name: str = proto.Field( proto.STRING, diff --git a/packages/google-cloud-bigtable/test_proxy/protos/bigtable_pb2.py b/packages/google-cloud-bigtable/test_proxy/protos/bigtable_pb2.py index edc90c3ecd80..1d7b7e1d135e 100644 --- a/packages/google-cloud-bigtable/test_proxy/protos/bigtable_pb2.py +++ b/packages/google-cloud-bigtable/test_proxy/protos/bigtable_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: google/bigtable/v2/bigtable.proto diff --git a/packages/google-cloud-bigtable/test_proxy/protos/data_pb2.py b/packages/google-cloud-bigtable/test_proxy/protos/data_pb2.py index 8b6e68df121e..a6c387c01610 100644 --- a/packages/google-cloud-bigtable/test_proxy/protos/data_pb2.py +++ b/packages/google-cloud-bigtable/test_proxy/protos/data_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: google/bigtable/v2/data.proto diff --git a/packages/google-cloud-bigtable/test_proxy/protos/request_stats_pb2.py b/packages/google-cloud-bigtable/test_proxy/protos/request_stats_pb2.py index 95fcc6e0f8f2..245b584fa6b9 100644 --- a/packages/google-cloud-bigtable/test_proxy/protos/request_stats_pb2.py +++ b/packages/google-cloud-bigtable/test_proxy/protos/request_stats_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/bigtable/v2/request_stats.proto """Generated protocol buffer code.""" diff --git a/packages/google-cloud-bigtable/test_proxy/protos/test_proxy_pb2.py b/packages/google-cloud-bigtable/test_proxy/protos/test_proxy_pb2.py index 1f85b086bf97..539c83d69e64 100644 --- a/packages/google-cloud-bigtable/test_proxy/protos/test_proxy_pb2.py +++ b/packages/google-cloud-bigtable/test_proxy/protos/test_proxy_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: test_proxy.proto diff --git a/packages/google-cloud-bigtable/test_proxy/protos/types_pb2.py b/packages/google-cloud-bigtable/test_proxy/protos/types_pb2.py index 7acdbf7f1e9e..85ae2f4c23bd 100644 --- a/packages/google-cloud-bigtable/test_proxy/protos/types_pb2.py +++ b/packages/google-cloud-bigtable/test_proxy/protos/types_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: google/bigtable/v2/types.proto diff --git a/packages/google-cloud-bigtable/tests/unit/data/execute_query/resources/singer_pb2.py b/packages/google-cloud-bigtable/tests/unit/data/execute_query/resources/singer_pb2.py index f5da249d4811..2579349f0753 100644 --- a/packages/google-cloud-bigtable/tests/unit/data/execute_query/resources/singer_pb2.py +++ b/packages/google-cloud-bigtable/tests/unit/data/execute_query/resources/singer_pb2.py @@ -1,4 +1,19 @@ # -*- coding: utf-8 -*- + +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # source: singer.proto """Generated protocol buffer code.""" diff --git a/packages/google-cloud-bigtable/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py b/packages/google-cloud-bigtable/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py index b77c531feab0..f6d810e14b3e 100644 --- a/packages/google-cloud-bigtable/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py +++ b/packages/google-cloud-bigtable/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py @@ -23523,7 +23523,11 @@ def test_update_table_rest_call_success(request_type): }, "change_stream_config": {"retention_period": {"seconds": 751, "nanos": 543}}, "deletion_protection": True, - "automated_backup_policy": {"retention_period": {}, "frequency": {}}, + "automated_backup_policy": { + "retention_period": {}, + "frequency": {}, + "locations": ["locations_value1", "locations_value2"], + }, "tiered_storage_config": {"infrequent_access": {"include_if_older_than": {}}}, "row_key_schema": { "fields": [