Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
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
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@
intersphinx_mapping = {
"python": ("http://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"google.api_core": (
"https://googleapis.dev/python/google-api-core/latest/",
None,
),
"grpc": ("https://grpc.io/grpc/python/", None),
}

Expand Down
5 changes: 3 additions & 2 deletions google/cloud/bigtable/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def size_bytes(self):

@property
def state(self):
""" The current state of this Backup.
"""The current state of this Backup.

:rtype: :class:`~google.cloud.bigtable_admin_v2.gapic.enums.Backup.State`
:returns: The current state of this Backup.
Expand Down Expand Up @@ -358,7 +358,8 @@ def update_expire_time(self, new_expire_time):
:param new_expire_time: the new expiration time timestamp
"""
backup_update = table_pb2.Backup(
name=self.name, expire_time=_datetime_to_pb_timestamp(new_expire_time),
name=self.name,
expire_time=_datetime_to_pb_timestamp(new_expire_time),
)
update_mask = field_mask_pb2.FieldMask(paths=["expire_time"])
api = self._instance._client.table_admin_client
Expand Down
8 changes: 4 additions & 4 deletions google/cloud/bigtable/batcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MaxMutationsError(ValueError):


class MutationsBatcher(object):
""" A MutationsBatcher is used in batch cases where the number of mutations
"""A MutationsBatcher is used in batch cases where the number of mutations
is large or unknown. It will store DirectRows in memory until one of the
size limits is reached, or an explicit call to flush() is performed. When
a flush event occurs, the DirectRows in memory will be sent to Cloud
Expand Down Expand Up @@ -65,7 +65,7 @@ def __init__(self, table, flush_count=FLUSH_COUNT, max_row_bytes=MAX_ROW_BYTES):
self.max_row_bytes = max_row_bytes

def mutate(self, row):
""" Add a row to the batch. If the current batch meets one of the size
"""Add a row to the batch. If the current batch meets one of the size
limits, the batch is sent synchronously.

For example:
Expand Down Expand Up @@ -105,7 +105,7 @@ def mutate(self, row):
self.flush()

def mutate_rows(self, rows):
""" Add a row to the batch. If the current batch meets one of the size
"""Add a row to the batch. If the current batch meets one of the size
limits, the batch is sent synchronously.

For example:
Expand All @@ -130,7 +130,7 @@ def mutate_rows(self, rows):
self.mutate(row)

def flush(self):
""" Sends the current. batch to Cloud Bigtable.
"""Sends the current. batch to Cloud Bigtable.
For example:

.. literalinclude:: snippets.py
Expand Down
4 changes: 3 additions & 1 deletion google/cloud/bigtable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ def __init__(
self._channel = channel
self.SCOPE = self._get_scopes()
super(Client, self).__init__(
project=project, credentials=credentials, client_options=client_options,
project=project,
credentials=credentials,
client_options=client_options,
)

def _get_scopes(self):
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/bigtable/row.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def _get_mutations(self, state=None): # pylint: disable=unused-argument
return self._pb_mutations

def get_mutations_size(self):
""" Gets the total mutations size for current row
"""Gets the total mutations size for current row

For example:

Expand Down
5 changes: 2 additions & 3 deletions google/cloud/bigtable/row_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ def _copy_from_previous(self, cell):


class _ReadRowsRequestManager(object):
""" Update the ReadRowsRequest message in case of failures by
"""Update the ReadRowsRequest message in case of failures by
filtering the already read keys.

:type message: class:`data_messages_v2_pb2.ReadRowsRequest`
Expand All @@ -617,8 +617,7 @@ def __init__(self, message, last_scanned_key, rows_read_so_far):
self.rows_read_so_far = rows_read_so_far

def build_updated_request(self):
""" Updates the given message request as per last scanned key
"""
"""Updates the given message request as per last scanned key"""
r_kwargs = {
"table_name": self.message.table_name,
"filter": self.message.filter,
Expand Down
10 changes: 5 additions & 5 deletions google/cloud/bigtable/row_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@


class RowSet(object):
""" Convenience wrapper of google.bigtable.v2.RowSet
"""Convenience wrapper of google.bigtable.v2.RowSet

Useful for creating a set of row keys and row ranges, which can
be passed to yield_rows method of class:`.Table.yield_rows`.
Useful for creating a set of row keys and row ranges, which can
be passed to yield_rows method of class:`.Table.yield_rows`.
"""

def __init__(self):
Expand Down Expand Up @@ -145,7 +145,7 @@ def _update_message_request(self, message):


class RowRange(object):
""" Convenience wrapper of google.bigtable.v2.RowRange
"""Convenience wrapper of google.bigtable.v2.RowRange

:type start_key: bytes
:param start_key: (Optional) Start key of the row range. If left empty,
Expand Down Expand Up @@ -195,7 +195,7 @@ def __ne__(self, other):
return not self == other

def get_range_kwargs(self):
""" Convert row range object to dict which can be passed to
"""Convert row range object to dict which can be passed to
google.bigtable.v2.RowRange add method.
"""
range_kwargs = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def location_path(cls, project, location):
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project,
"projects/{project}",
project=project,
)

def __init__(
Expand Down Expand Up @@ -220,7 +221,9 @@ def __init__(
self.transport = transport
else:
self.transport = bigtable_instance_admin_grpc_transport.BigtableInstanceAdminGrpcTransport(
address=api_endpoint, channel=channel, credentials=credentials,
address=api_endpoint,
channel=channel,
credentials=credentials,
)

if client_info is None:
Expand Down Expand Up @@ -416,7 +419,9 @@ def get_instance(
client_info=self._client_info,
)

request = bigtable_instance_admin_pb2.GetInstanceRequest(name=name,)
request = bigtable_instance_admin_pb2.GetInstanceRequest(
name=name,
)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -489,7 +494,8 @@ def list_instances(
)

request = bigtable_instance_admin_pb2.ListInstancesRequest(
parent=parent, page_token=page_token,
parent=parent,
page_token=page_token,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -683,7 +689,8 @@ def partial_update_instance(
)

request = bigtable_instance_admin_pb2.PartialUpdateInstanceRequest(
instance=instance, update_mask=update_mask,
instance=instance,
update_mask=update_mask,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -757,7 +764,9 @@ def delete_instance(
client_info=self._client_info,
)

request = bigtable_instance_admin_pb2.DeleteInstanceRequest(name=name,)
request = bigtable_instance_admin_pb2.DeleteInstanceRequest(
name=name,
)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -854,7 +863,9 @@ def create_cluster(
)

request = bigtable_instance_admin_pb2.CreateClusterRequest(
parent=parent, cluster_id=cluster_id, cluster=cluster,
parent=parent,
cluster_id=cluster_id,
cluster=cluster,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -931,7 +942,9 @@ def get_cluster(
client_info=self._client_info,
)

request = bigtable_instance_admin_pb2.GetClusterRequest(name=name,)
request = bigtable_instance_admin_pb2.GetClusterRequest(
name=name,
)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1007,7 +1020,8 @@ def list_clusters(
)

request = bigtable_instance_admin_pb2.ListClustersRequest(
parent=parent, page_token=page_token,
parent=parent,
page_token=page_token,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1181,7 +1195,9 @@ def delete_cluster(
client_info=self._client_info,
)

request = bigtable_instance_admin_pb2.DeleteClusterRequest(name=name,)
request = bigtable_instance_admin_pb2.DeleteClusterRequest(
name=name,
)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1346,7 +1362,9 @@ def get_app_profile(
client_info=self._client_info,
)

request = bigtable_instance_admin_pb2.GetAppProfileRequest(name=name,)
request = bigtable_instance_admin_pb2.GetAppProfileRequest(
name=name,
)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1441,7 +1459,8 @@ def list_app_profiles(
)

request = bigtable_instance_admin_pb2.ListAppProfilesRequest(
parent=parent, page_size=page_size,
parent=parent,
page_size=page_size,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1627,7 +1646,8 @@ def delete_app_profile(
)

request = bigtable_instance_admin_pb2.DeleteAppProfileRequest(
name=name, ignore_warnings=ignore_warnings,
name=name,
ignore_warnings=ignore_warnings,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1707,7 +1727,8 @@ def get_iam_policy(
)

request = iam_policy_pb2.GetIamPolicyRequest(
resource=resource, options=options_,
resource=resource,
options=options_,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1791,7 +1812,10 @@ def set_iam_policy(
client_info=self._client_info,
)

request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy,)
request = iam_policy_pb2.SetIamPolicyRequest(
resource=resource,
policy=policy,
)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1871,7 +1895,8 @@ def test_iam_permissions(
)

request = iam_policy_pb2.TestIamPermissionsRequest(
resource=resource, permissions=permissions,
resource=resource,
permissions=permissions,
)
if metadata is None:
metadata = []
Expand Down
Loading