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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions google/cloud/bigtable_admin_v2/types/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,20 @@ class Instance(proto.Message):
Output only. Reserved for future use.

This field is a member of `oneof`_ ``_satisfies_pzi``.
tags (MutableMapping[str, str]):
Optional. Input only. Immutable. Tag
keys/values directly bound to this resource. For
example:

- "123/environment": "production",
- "123/costCenter": "marketing"

Tags and Labels (above) are both used to bind
metadata to resources, with different use-cases.
See
https://cloud.google.com/resource-manager/docs/tags/tags-overview
for an in-depth overview on the difference
between tags and labels.
"""

class State(proto.Enum):
Expand Down Expand Up @@ -169,6 +183,11 @@ class Type(proto.Enum):
number=11,
optional=True,
)
tags: MutableMapping[str, str] = proto.MapField(
proto.STRING,
proto.STRING,
number=12,
)


class AutoscalingTargets(proto.Message):
Expand Down
48 changes: 18 additions & 30 deletions google/cloud/bigtable_v2/services/bigtable/async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,11 @@ def read_rows(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -515,13 +513,11 @@ def sample_row_keys(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -660,13 +656,11 @@ async def mutate_row(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -799,13 +793,11 @@ def mutate_rows(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -979,13 +971,11 @@ async def check_and_mutate_row(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -1242,13 +1232,11 @@ async def read_modify_write_row(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down
48 changes: 18 additions & 30 deletions google/cloud/bigtable_v2/services/bigtable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,13 +867,11 @@ def read_rows(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -988,13 +986,11 @@ def sample_row_keys(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -1130,13 +1126,11 @@ def mutate_row(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -1266,13 +1260,11 @@ def mutate_rows(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -1443,13 +1435,11 @@ def check_and_mutate_row(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down Expand Up @@ -1700,13 +1690,11 @@ def read_modify_write_row(
header_params["app_profile_id"] = request.app_profile_id

routing_param_regex = re.compile(
"^(?P<authorized_view_name>projects/[^/]+/instances/[^/]+/tables/[^/]+/authorizedViews/[^/]+)$"
"^(?P<table_name>projects/[^/]+/instances/[^/]+/tables/[^/]+)(?:/.*)?$"
)
regex_match = routing_param_regex.match(request.authorized_view_name)
if regex_match and regex_match.group("authorized_view_name"):
header_params["authorized_view_name"] = regex_match.group(
"authorized_view_name"
)
if regex_match and regex_match.group("table_name"):
header_params["table_name"] = regex_match.group("table_name")

if header_params:
metadata = tuple(metadata) + (
Expand Down
66 changes: 66 additions & 0 deletions google/cloud/bigtable_v2/types/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@ class Type(proto.Message):
map_type (google.cloud.bigtable_v2.types.Type.Map):
Map

This field is a member of `oneof`_ ``kind``.
proto_type (google.cloud.bigtable_v2.types.Type.Proto):
Proto

This field is a member of `oneof`_ ``kind``.
enum_type (google.cloud.bigtable_v2.types.Type.Enum):
Enum

This field is a member of `oneof`_ ``kind``.
"""

Expand Down Expand Up @@ -351,6 +359,52 @@ class Field(proto.Message):
message="Type.Struct.Field",
)

class Proto(proto.Message):
r"""A protobuf message type. Values of type ``Proto`` are stored in
``Value.bytes_value``.

Attributes:
schema_bundle_id (str):
The ID of the schema bundle that this proto
is defined in.
message_name (str):
The fully qualified name of the protobuf
message, including package. In the format of
"foo.bar.Message".
"""

schema_bundle_id: str = proto.Field(
proto.STRING,
number=1,
)
message_name: str = proto.Field(
proto.STRING,
number=2,
)

class Enum(proto.Message):
r"""A protobuf enum type. Values of type ``Enum`` are stored in
``Value.int_value``.

Attributes:
schema_bundle_id (str):
The ID of the schema bundle that this enum is
defined in.
enum_name (str):
The fully qualified name of the protobuf enum
message, including package. In the format of
"foo.bar.EnumMessage".
"""

schema_bundle_id: str = proto.Field(
proto.STRING,
number=1,
)
enum_name: str = proto.Field(
proto.STRING,
number=2,
)

class Array(proto.Message):
r"""An ordered list of elements of a given type. Values of type
``Array`` are stored in ``Value.array_value``.
Expand Down Expand Up @@ -574,6 +628,18 @@ class HyperLogLogPlusPlusUniqueCount(proto.Message):
oneof="kind",
message=Map,
)
proto_type: Proto = proto.Field(
proto.MESSAGE,
number=13,
oneof="kind",
message=Proto,
)
enum_type: Enum = proto.Field(
proto.MESSAGE,
number=14,
oneof="kind",
message=Enum,
)


__all__ = tuple(sorted(__protobuf__.manifest))
21 changes: 8 additions & 13 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,17 @@ def get_staging_dirs(
# fix tests
s.replace(
"tests/unit/gapic/bigtable_v2/test_bigtable.py",
'expected_headers = {"name": "projects/sample1/instances/sample2"}',
'expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""}'
'assert \(\n\s*gapic_v1\.routing_header\.to_grpc_metadata\(expected_headers\) in kw\["metadata"\]\n.*',
"""
# assert the expected headers are present, in any order
routing_string = next(iter([m[1] for m in kw["metadata"] if m[0] == 'x-goog-request-params']))
assert all([f"{k}={v}" in routing_string for k,v in expected_headers.items()])
"""
)
s.replace(
"tests/unit/gapic/bigtable_v2/test_bigtable.py",
"""
expected_headers = {
"authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/authorizedViews/sample4"
}
""",
"""
expected_headers = {
"app_profile_id": "",
"authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/authorizedViews/sample4"
}
"""
'expected_headers = {"name": "projects/sample1/instances/sample2"}',
'expected_headers = {"name": "projects/sample1/instances/sample2", "app_profile_id": ""}'
)
s.replace(
"tests/unit/gapic/bigtable_v2/test_bigtable.py",
Expand Down
Loading
Loading