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 13 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.

971 changes: 971 additions & 0 deletions google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py

Large diffs are not rendered by default.

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))
18 changes: 14 additions & 4 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,25 @@ def get_staging_dirs(
s.replace(
"tests/unit/gapic/bigtable_v2/test_bigtable.py",
"""
"authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/sample4"
}
\)

assert args\[0\] == request_msg

expected_headers = {
"authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/authorizedViews/sample4"
}
"table_name": "projects/sample1/instances/sample2/tables/sample3",
""",
"""
"authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/sample4"
}
)

assert args[0] == request_msg

expected_headers = {
"app_profile_id": "",
"authorized_view_name": "projects/sample1/instances/sample2/tables/sample3/authorizedViews/sample4"
}
"table_name": "projects/sample1/instances/sample2/tables/sample3"
"""
)
s.replace(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# -*- 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 code. DO NOT EDIT!
#
# Snippet for CreateAppProfile
# NOTE: This snippet has been automatically generated for illustrative purposes only.
# It may require modifications to work in your environment.

# To install the latest published package dependency, execute the following:
# python3 -m pip install google-cloud-bigtable-admin


# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async]
# This snippet has been automatically generated and should be regarded as a
# code template only.
# It will require modifications to work:
# - It may require correct/in-range values for request initialization.
# - It may require specifying regional endpoints when creating the service
# client as shown in:
# https://googleapis.dev/python/google-api-core/latest/client_options.html
from google.cloud import bigtable_admin_v2


async def sample_create_app_profile():
# Create a client
client = bigtable_admin_v2.BigtableInstanceAdminAsyncClient()

# Initialize request argument(s)
app_profile = bigtable_admin_v2.AppProfile()
app_profile.priority = "PRIORITY_HIGH"

request = bigtable_admin_v2.CreateAppProfileRequest(
parent="parent_value",
app_profile_id="app_profile_id_value",
app_profile=app_profile,
)

# Make the request
response = await client.create_app_profile(request=request)

# Handle the response
print(response)

# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async]
Loading
Loading