Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions google/cloud/bigtable/admin/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- 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.
#
__version__ = "2.30.1" # {x-release-please-version}
16 changes: 16 additions & 0 deletions google/cloud/bigtable/admin_v2/gapic_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- 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.
#
__version__ = "2.30.1" # {x-release-please-version}
2 changes: 1 addition & 1 deletion google/cloud/bigtable/app_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import re

from google.cloud.bigtable.enums import RoutingPolicyType
from google.cloud.bigtable_admin_v2.types import instance
from google.cloud.bigtable.admin_v2.types import instance
from google.protobuf import field_mask_pb2
from google.api_core.exceptions import NotFound

Expand Down
23 changes: 11 additions & 12 deletions google/cloud/bigtable/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import re

from google.cloud._helpers import _datetime_to_pb_timestamp # type: ignore
from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient
from google.cloud.bigtable_admin_v2.types import table
from google.cloud.bigtable.admin_v2 import BaseBigtableTableAdminClient
from google.cloud.bigtable.admin_v2.types import table
from google.cloud.bigtable.encryption_info import EncryptionInfo
from google.cloud.bigtable.policy import Policy
from google.cloud.exceptions import NotFound # type: ignore
Expand Down Expand Up @@ -106,7 +106,7 @@ def name(self):
if not self._cluster:
raise ValueError('"cluster" parameter must be set')

return BigtableTableAdminClient.backup_path(
return BaseBigtableTableAdminClient.backup_path(
project=self._instance._client.project,
instance=self._instance.instance_id,
cluster=self._cluster,
Expand Down Expand Up @@ -141,7 +141,7 @@ def parent(self):
:returns: A full path to the parent cluster.
"""
if not self._parent and self._cluster:
self._parent = BigtableTableAdminClient.cluster_path(
self._parent = BaseBigtableTableAdminClient.cluster_path(
project=self._instance._client.project,
instance=self._instance.instance_id,
cluster=self._cluster,
Expand All @@ -163,7 +163,7 @@ def source_table(self):
:returns: The Table name.
"""
if not self._source_table and self.table_id:
self._source_table = BigtableTableAdminClient.table_path(
self._source_table = BaseBigtableTableAdminClient.table_path(
project=self._instance._client.project,
instance=self._instance.instance_id,
table=self.table_id,
Expand Down Expand Up @@ -226,7 +226,7 @@ def size_bytes(self):
def state(self):
"""The current state of this Backup.

:rtype: :class:`~google.cloud.bigtable_admin_v2.gapic.enums.Backup.State`
:rtype: :class:`~google.cloud.bigtable.admin_v2.types.table.Backup.State`
:returns: The current state of this Backup.
"""
return self._state
Expand Down Expand Up @@ -305,8 +305,7 @@ def create(self, cluster_id=None):
created Backup.

:rtype: :class:`~google.api_core.operation.Operation`
:returns: :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture`
instance, to be used to poll the status of the 'create' request
:returns: A future to be used to poll the status of the 'create' request
:raises Conflict: if the Backup already exists
:raises NotFound: if the Instance owning the Backup does not exist
:raises BadRequest: if the `table` or `expire_time` values are invalid,
Expand Down Expand Up @@ -343,7 +342,7 @@ def get(self):
"""Retrieves metadata of a pending or completed Backup.

:returns: An instance of
:class:`~google.cloud.bigtable_admin_v2.types.Backup`
:class:`~google.cloud.bigtable.admin_v2.types.Backup`

:raises google.api_core.exceptions.GoogleAPICallError: If the request
failed for any reason.
Expand Down Expand Up @@ -412,7 +411,7 @@ def restore(self, table_id, instance_id=None):
:param instance_id: (Optional) The ID of the Instance to restore the
backup into, if different from the current one.

:rtype: :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture`
:rtype: :class:`~google.api_core.operation.Operation`
:returns: A future to be used to poll the status of the 'restore'
request.

Expand All @@ -426,14 +425,14 @@ def restore(self, table_id, instance_id=None):
"""
api = self._instance._client.table_admin_client
if instance_id:
parent = BigtableTableAdminClient.instance_path(
parent = BaseBigtableTableAdminClient.instance_path(
project=self._instance._client.project,
instance=instance_id,
)
else:
parent = self._instance.name

return api.restore_table(
return api._restore_table(
request={"parent": parent, "table_id": table_id, "backup": self.name}
)

Expand Down
16 changes: 8 additions & 8 deletions google/cloud/bigtable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
from google.auth.credentials import AnonymousCredentials # type: ignore

from google.cloud import bigtable_v2
from google.cloud import bigtable_admin_v2
from google.cloud.bigtable import admin_v2
from google.cloud.bigtable_v2.services.bigtable.transports import BigtableGrpcTransport
from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports import (
from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.transports import (
BigtableInstanceAdminGrpcTransport,
)
from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports import (
from google.cloud.bigtable.admin_v2.services.bigtable_table_admin.transports import (
BigtableTableAdminGrpcTransport,
)

Expand All @@ -50,7 +50,7 @@

from google.cloud.client import ClientWithProject # type: ignore

from google.cloud.bigtable_admin_v2.types import instance
from google.cloud.bigtable.admin_v2.types import instance
from google.cloud.bigtable.cluster import _CLUSTER_NAME_RE
from google.cloud.environment_vars import BIGTABLE_EMULATOR # type: ignore

Expand Down Expand Up @@ -325,11 +325,11 @@ def table_admin_client(self):
raise ValueError("Client is not an admin client.")

transport = self._create_gapic_client_channel(
bigtable_admin_v2.BigtableTableAdminClient,
admin_v2.BaseBigtableTableAdminClient,
BigtableTableAdminGrpcTransport,
)
klass = _create_gapic_client(
bigtable_admin_v2.BigtableTableAdminClient,
admin_v2.BaseBigtableTableAdminClient,
client_options=self._admin_client_options,
transport=transport,
)
Expand Down Expand Up @@ -358,11 +358,11 @@ def instance_admin_client(self):
raise ValueError("Client is not an admin client.")

transport = self._create_gapic_client_channel(
bigtable_admin_v2.BigtableInstanceAdminClient,
admin_v2.BigtableInstanceAdminClient,
BigtableInstanceAdminGrpcTransport,
)
klass = _create_gapic_client(
bigtable_admin_v2.BigtableInstanceAdminClient,
admin_v2.BigtableInstanceAdminClient,
client_options=self._admin_client_options,
transport=transport,
)
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


import re
from google.cloud.bigtable_admin_v2.types import instance
from google.cloud.bigtable.admin_v2.types import instance
from google.api_core.exceptions import NotFound
from google.protobuf import field_mask_pb2

Expand Down
10 changes: 5 additions & 5 deletions google/cloud/bigtable/column_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@


from google.cloud import _helpers
from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2
from google.cloud.bigtable_admin_v2.types import (
from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2
from google.cloud.bigtable.admin_v2.types import (
bigtable_table_admin as table_admin_v2_pb2,
)
from google.api_core.gapic_v1.method import DEFAULT
Expand Down Expand Up @@ -275,7 +275,7 @@ def create(self):
client = self._table._instance._client
# data it contains are the GC rule and the column family ID already
# stored on this instance.
client.table_admin_client.modify_column_families(
client.table_admin_client._modify_column_families(
request={"name": self._table.name, "modifications": [modification]},
timeout=DEFAULT,
)
Expand Down Expand Up @@ -303,7 +303,7 @@ def update(self):
client = self._table._instance._client
# data it contains are the GC rule and the column family ID already
# stored on this instance.
client.table_admin_client.modify_column_families(
client.table_admin_client._modify_column_families(
request={"name": self._table.name, "modifications": [modification]},
timeout=DEFAULT,
)
Expand All @@ -326,7 +326,7 @@ def delete(self):
client = self._table._instance._client
# data it contains are the GC rule and the column family ID already
# stored on this instance.
client.table_admin_client.modify_column_families(
client.table_admin_client._modify_column_families(
request={"name": self._table.name, "modifications": [modification]},
timeout=DEFAULT,
)
Expand Down
6 changes: 3 additions & 3 deletions google/cloud/bigtable/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# limitations under the License.
"""Wrappers for gapic enum types."""

from google.cloud.bigtable_admin_v2.types import common
from google.cloud.bigtable_admin_v2.types import instance
from google.cloud.bigtable_admin_v2.types import table
from google.cloud.bigtable.admin_v2.types import common
from google.cloud.bigtable.admin_v2.types import instance
from google.cloud.bigtable.admin_v2.types import table


class StorageType(object):
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from google.protobuf import field_mask_pb2

from google.cloud.bigtable_admin_v2.types import instance
from google.cloud.bigtable.admin_v2.types import instance

from google.iam.v1 import options_pb2 # type: ignore

Expand Down
14 changes: 7 additions & 7 deletions google/cloud/bigtable/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
from google.cloud.bigtable.row_set import RowRange
from google.cloud.bigtable import enums
from google.cloud.bigtable_v2.types import bigtable as data_messages_v2_pb2
from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient
from google.cloud.bigtable_admin_v2.types import table as admin_messages_v2_pb2
from google.cloud.bigtable_admin_v2.types import (
from google.cloud.bigtable.admin_v2 import BaseBigtableTableAdminClient
from google.cloud.bigtable.admin_v2.types import table as admin_messages_v2_pb2
from google.cloud.bigtable.admin_v2.types import (
bigtable_table_admin as table_admin_messages_v2_pb2,
)

Expand Down Expand Up @@ -990,7 +990,7 @@ def list_backups(self, cluster_id=None, filter_=None, order_by=None, page_size=0
if filter_:
backups_filter = "({}) AND ({})".format(backups_filter, filter_)

parent = BigtableTableAdminClient.cluster_path(
parent = BaseBigtableTableAdminClient.cluster_path(
project=self._instance._client.project,
instance=self._instance.instance_id,
cluster=cluster_id,
Expand Down Expand Up @@ -1037,7 +1037,7 @@ def restore(self, new_table_id, cluster_id=None, backup_id=None, backup_name=Non
and `backup_id` parameters even of such specified.

:return: An instance of
:class:`~google.cloud.bigtable_admin_v2.types._OperationFuture`.
:class:`~google.api_core.operation.Operation`.

:raises: google.api_core.exceptions.AlreadyExists: If the table
already exists.
Expand All @@ -1049,13 +1049,13 @@ def restore(self, new_table_id, cluster_id=None, backup_id=None, backup_name=Non
"""
api = self._instance._client.table_admin_client
if not backup_name:
backup_name = BigtableTableAdminClient.backup_path(
backup_name = BaseBigtableTableAdminClient.backup_path(
project=self._instance._client.project,
instance=self._instance.instance_id,
cluster=cluster_id,
backup=backup_id,
)
return api.restore_table(
return api._restore_table(
request={
"parent": self._instance.name,
"table_id": new_table_id,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
extras_require=extras,
scripts=[
"scripts/fixup_bigtable_v2_keywords.py",
"scripts/fixup_bigtable_admin_v2_keywords.py",
"scripts/fixup_admin_v2_keywords.py",
],
python_requires=">=3.7",
include_package_data=True,
Expand Down
2 changes: 1 addition & 1 deletion tests/system/data/setup_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def instance_id(admin_client, project_id, cluster_config):
"""
Returns BIGTABLE_TEST_INSTANCE if set, otherwise creates a new temporary instance for the test session
"""
from google.cloud.bigtable_admin_v2 import types
from google.cloud.bigtable.admin_v2 import types
from google.api_core import exceptions
from google.cloud.environment_vars import BIGTABLE_EMULATOR

Expand Down
4 changes: 2 additions & 2 deletions tests/system/data/test_system_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def column_family_config(self):
"""
specify column families to create when creating a new test table
"""
from google.cloud.bigtable_admin_v2 import types
from google.cloud.bigtable.admin_v2 import types

return {TEST_FAMILY: types.ColumnFamily(), TEST_FAMILY_2: types.ColumnFamily()}

Expand All @@ -127,7 +127,7 @@ def cluster_config(self, project_id):
"""
Configuration for the clusters to use when creating a new instance
"""
from google.cloud.bigtable_admin_v2 import types
from google.cloud.bigtable.admin_v2 import types

cluster = {
"test-cluster": types.Cluster(
Expand Down
4 changes: 2 additions & 2 deletions tests/system/data/test_system_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def table(self, client, table_id, instance_id):
@pytest.fixture(scope="session")
def column_family_config(self):
"""specify column families to create when creating a new test table"""
from google.cloud.bigtable_admin_v2 import types
from google.cloud.bigtable.admin_v2 import types

return {TEST_FAMILY: types.ColumnFamily(), TEST_FAMILY_2: types.ColumnFamily()}

Expand All @@ -101,7 +101,7 @@ def init_table_id(self):
@pytest.fixture(scope="session")
def cluster_config(self, project_id):
"""Configuration for the clusters to use when creating a new instance"""
from google.cloud.bigtable_admin_v2 import types
from google.cloud.bigtable.admin_v2 import types

cluster = {
"test-cluster": types.Cluster(
Expand Down
Loading
Loading