feat: add deletion_protection support for LVs by gcf-owl-bot[bot] · Pull Request #1108 · googleapis/python-bigtable · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

feat: add deletion_protection support for LVs #1108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 2, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,11 @@ def intercept_unary_unary(self, continuation, client_call_details, request):
f"Sending request for {client_call_details.method}",
extra={
"serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin",
"rpcName": client_call_details.method,
"rpcName": str(client_call_details.method),
"request": grpc_request,
"metadata": grpc_request["metadata"],
},
)

response = continuation(client_call_details, request)
if logging_enabled: # pragma: NO COVER
response_metadata = response.trailing_metadata()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,11 @@ def intercept_unary_unary(self, continuation, client_call_details, request):
f"Sending request for {client_call_details.method}",
extra={
"serviceName": "google.bigtable.admin.v2.BigtableTableAdmin",
"rpcName": client_call_details.method,
"rpcName": str(client_call_details.method),
"request": grpc_request,
"metadata": grpc_request["metadata"],
},
)

response = continuation(client_call_details, request)
if logging_enabled: # pragma: NO COVER
response_metadata = response.trailing_metadata()
Expand Down
7 changes: 7 additions & 0 deletions google/cloud/bigtable_admin_v2/types/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,9 @@ class LogicalView(proto.Message):
that the client has an up-to-date value before
proceeding. The server returns an ABORTED error
on a mismatched etag.
deletion_protection (bool):
Optional. Set to true to make the LogicalView
protected against deletion.
"""

name: str = proto.Field(
Expand All @@ -773,6 +776,10 @@ class LogicalView(proto.Message):
proto.STRING,
number=3,
)
deletion_protection: bool = proto.Field(
proto.BOOL,
number=6,
)


class MaterializedView(proto.Message):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,11 @@ def intercept_unary_unary(self, continuation, client_call_details, request):
f"Sending request for {client_call_details.method}",
extra={
"serviceName": "google.bigtable.v2.Bigtable",
"rpcName": client_call_details.method,
"rpcName": str(client_call_details.method),
"request": grpc_request,
"metadata": grpc_request["metadata"],
},
)

response = continuation(client_call_details, request)
if logging_enabled: # pragma: NO COVER
response_metadata = response.trailing_metadata()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9000,6 +9000,7 @@ def test_get_logical_view(request_type, transport: str = "grpc"):
name="name_value",
query="query_value",
etag="etag_value",
deletion_protection=True,
)
response = client.get_logical_view(request)

Expand All @@ -9014,6 +9015,7 @@ def test_get_logical_view(request_type, transport: str = "grpc"):
assert response.name == "name_value"
assert response.query == "query_value"
assert response.etag == "etag_value"
assert response.deletion_protection is True


def test_get_logical_view_non_empty_request_with_auto_populated_field():
Expand Down Expand Up @@ -9145,6 +9147,7 @@ async def test_get_logical_view_async(
name="name_value",
query="query_value",
etag="etag_value",
deletion_protection=True,
)
)
response = await client.get_logical_view(request)
Expand All @@ -9160,6 +9163,7 @@ async def test_get_logical_view_async(
assert response.name == "name_value"
assert response.query == "query_value"
assert response.etag == "etag_value"
assert response.deletion_protection is True


@pytest.mark.asyncio
Expand Down Expand Up @@ -19861,6 +19865,7 @@ async def test_get_logical_view_empty_call_grpc_asyncio():
name="name_value",
query="query_value",
etag="etag_value",
deletion_protection=True,
)
)
await client.get_logical_view(request=None)
Expand Down Expand Up @@ -23249,6 +23254,7 @@ def test_create_logical_view_rest_call_success(request_type):
"name": "name_value",
"query": "query_value",
"etag": "etag_value",
"deletion_protection": True,
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down Expand Up @@ -23452,6 +23458,7 @@ def test_get_logical_view_rest_call_success(request_type):
name="name_value",
query="query_value",
etag="etag_value",
deletion_protection=True,
)

# Wrap the value into a proper Response obj
Expand All @@ -23471,6 +23478,7 @@ def test_get_logical_view_rest_call_success(request_type):
assert response.name == "name_value"
assert response.query == "query_value"
assert response.etag == "etag_value"
assert response.deletion_protection is True


@pytest.mark.parametrize("null_interceptor", [True, False])
Expand Down Expand Up @@ -23720,6 +23728,7 @@ def test_update_logical_view_rest_call_success(request_type):
"name": "projects/sample1/instances/sample2/logicalViews/sample3",
"query": "query_value",
"etag": "etag_value",
"deletion_protection": True,
}
# The version of a generated dependency at test runtime may differ from the version used during generation.
# Delete any fields which are not present in the current runtime dependency
Expand Down
Loading

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.