Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit b66553f

Browse files
committed
Merge branch 'main' into autogen-feature-branch
2 parents 2d24d7d + 1a5b4b5 commit b66553f

85 files changed

Lines changed: 3708 additions & 1284 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cross_sync/transformers.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ def visit_FunctionDef(self, node):
8181

8282
def visit_Constant(self, node):
8383
"""Replace string type annotations"""
84-
node.s = self.replacements.get(node.s, node.s)
84+
try:
85+
node.s = self.replacements.get(node.s, node.s)
86+
except TypeError:
87+
# ignore unhashable types (e.g. list)
88+
pass
8589
return node
8690

8791

.github/workflows/conformance.yaml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,15 @@ jobs:
2424
runs-on: ubuntu-latest
2525
strategy:
2626
matrix:
27-
test-version: [ "v0.0.2" ]
27+
test-version: [ "v0.0.4" ]
2828
py-version: [ 3.8 ]
29-
client-type: [ "async", "sync", "legacy" ]
29+
client-type: [ "async", "sync"]
30+
# None of the clients currently support reverse scans, execute query plan refresh, retry info, or routing cookie
3031
include:
32+
- client-type: "async"
33+
test_args: "-skip \"PlanRefresh|_Reverse|_WithRetryInfo|_WithRoutingCookie\""
3134
- client-type: "sync"
32-
# sync client does not support concurrent streams
33-
test_args: "-skip _Generic_MultiStream"
34-
- client-type: "legacy"
35-
# legacy client is synchronous and does not support concurrent streams
36-
# legacy client does not expose mutate_row. Disable those tests
37-
test_args: "-skip _Generic_MultiStream -skip TestMutateRow_"
35+
test_args: "-skip \"PlanRefresh|_Reverse|_WithRetryInfo|_WithRoutingCookie|_Generic_MultiStream\""
3836
fail-fast: false
3937
name: "${{ matrix.client-type }} client / python ${{ matrix.py-version }} / test tag ${{ matrix.test-version }}"
4038
steps:

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.30.1"
2+
".": "2.31.0"
33
}

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44

55
[1]: https://pypi.org/project/google-cloud-bigtable/#history
66

7+
## [2.31.0](https://github.com/googleapis/python-bigtable/compare/v2.30.1...v2.31.0) (2025-05-22)
8+
9+
10+
### Features
11+
12+
* Add deletion_protection support for LVs ([#1108](https://github.com/googleapis/python-bigtable/issues/1108)) ([c6d384d](https://github.com/googleapis/python-bigtable/commit/c6d384d4a104c182326e22dc3f10b7b905780dee))
13+
* Support authorized views ([#1034](https://github.com/googleapis/python-bigtable/issues/1034)) ([97a0198](https://github.com/googleapis/python-bigtable/commit/97a019833d82e617769c56761aa5548d3ab896b9))
14+
* Throw better error on invalid metadata response ([#1107](https://github.com/googleapis/python-bigtable/issues/1107)) ([2642317](https://github.com/googleapis/python-bigtable/commit/2642317077b723ca8fd62aa86322b524868c2c4d))
15+
16+
17+
### Bug Fixes
18+
19+
* Re-add py-typed file for bigtable package ([#1085](https://github.com/googleapis/python-bigtable/issues/1085)) ([0c322c7](https://github.com/googleapis/python-bigtable/commit/0c322c79ecbe4cde3e79d8e83ac655a978d07877))
20+
721
## [2.30.1](https://github.com/googleapis/python-bigtable/compare/v2.30.0...v2.30.1) (2025-04-17)
822

923

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Authorized View Async
2+
~~~~~~~~~~~~~~~~~~~~~
3+
4+
.. note::
5+
6+
It is generally not recommended to use the async client in an otherwise synchronous codebase. To make use of asyncio's
7+
performance benefits, the codebase should be designed to be async from the ground up.
8+
9+
.. autoclass:: google.cloud.bigtable.data._async.client.AuthorizedViewAsync
10+
:members:
11+
:inherited-members:

docs/data_client/async_data_table.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ Table Async
88

99
.. autoclass:: google.cloud.bigtable.data._async.client.TableAsync
1010
:members:
11-
:show-inheritance:
11+
:inherited-members:

docs/data_client/data_client_usage.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Sync Surface
99

1010
sync_data_client
1111
sync_data_table
12+
sync_data_authorized_view
1213
sync_data_mutations_batcher
1314
sync_data_execute_query_iterator
1415

@@ -20,6 +21,7 @@ Async Surface
2021

2122
async_data_client
2223
async_data_table
24+
async_data_authorized_view
2325
async_data_mutations_batcher
2426
async_data_execute_query_iterator
2527

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Authorized View
2+
~~~~~~~~~~~~~~~
3+
4+
.. autoclass:: google.cloud.bigtable.data._sync_autogen.client.AuthorizedView
5+
:members:
6+
:inherited-members:

google/cloud/bigtable/data/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717

1818
from google.cloud.bigtable.data._async.client import BigtableDataClientAsync
1919
from google.cloud.bigtable.data._async.client import TableAsync
20+
from google.cloud.bigtable.data._async.client import AuthorizedViewAsync
2021
from google.cloud.bigtable.data._async.mutations_batcher import MutationsBatcherAsync
2122
from google.cloud.bigtable.data._sync_autogen.client import BigtableDataClient
2223
from google.cloud.bigtable.data._sync_autogen.client import Table
24+
from google.cloud.bigtable.data._sync_autogen.client import AuthorizedView
2325
from google.cloud.bigtable.data._sync_autogen.mutations_batcher import MutationsBatcher
2426

2527
from google.cloud.bigtable.data.read_rows_query import ReadRowsQuery
@@ -76,9 +78,11 @@
7678
__all__ = (
7779
"BigtableDataClientAsync",
7880
"TableAsync",
81+
"AuthorizedViewAsync",
7982
"MutationsBatcherAsync",
8083
"BigtableDataClient",
8184
"Table",
85+
"AuthorizedView",
8286
"MutationsBatcher",
8387
"RowKeySamples",
8488
"ReadRowsQuery",

google/cloud/bigtable/data/_async/_mutate_rows.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
from __future__ import annotations
1616

1717
from typing import Sequence, TYPE_CHECKING
18-
import functools
1918

2019
from google.api_core import exceptions as core_exceptions
2120
from google.api_core import retry as retries
21+
import google.cloud.bigtable_v2.types.bigtable as types_pb
2222
import google.cloud.bigtable.data.exceptions as bt_exceptions
2323
from google.cloud.bigtable.data._helpers import _attempt_timeout_generator
2424
from google.cloud.bigtable.data._helpers import _retry_exception_factory
@@ -36,12 +36,16 @@
3636
from google.cloud.bigtable_v2.services.bigtable.async_client import (
3737
BigtableAsyncClient as GapicClientType,
3838
)
39-
from google.cloud.bigtable.data._async.client import TableAsync as TableType
39+
from google.cloud.bigtable.data._async.client import ( # type: ignore
40+
_DataApiTargetAsync as TargetType,
41+
)
4042
else:
4143
from google.cloud.bigtable_v2.services.bigtable.client import ( # type: ignore
4244
BigtableClient as GapicClientType,
4345
)
44-
from google.cloud.bigtable.data._sync_autogen.client import Table as TableType # type: ignore
46+
from google.cloud.bigtable.data._sync_autogen.client import ( # type: ignore
47+
_DataApiTarget as TargetType,
48+
)
4549

4650
__CROSS_SYNC_OUTPUT__ = "google.cloud.bigtable.data._sync_autogen._mutate_rows"
4751

@@ -59,7 +63,7 @@ class _MutateRowsOperationAsync:
5963
6064
Args:
6165
gapic_client: the client to use for the mutate_rows call
62-
table: the table associated with the request
66+
target: the table or view associated with the request
6367
mutation_entries: a list of RowMutationEntry objects to send to the server
6468
operation_timeout: the timeout to use for the entire operation, in seconds.
6569
attempt_timeout: the timeout to use for each mutate_rows attempt, in seconds.
@@ -70,7 +74,7 @@ class _MutateRowsOperationAsync:
7074
def __init__(
7175
self,
7276
gapic_client: GapicClientType,
73-
table: TableType,
77+
target: TargetType,
7478
mutation_entries: list["RowMutationEntry"],
7579
operation_timeout: float,
7680
attempt_timeout: float | None,
@@ -84,13 +88,8 @@ def __init__(
8488
f"{_MUTATE_ROWS_REQUEST_MUTATION_LIMIT} mutations across "
8589
f"all entries. Found {total_mutations}."
8690
)
87-
# create partial function to pass to trigger rpc call
88-
self._gapic_fn = functools.partial(
89-
gapic_client.mutate_rows,
90-
table_name=table.table_name,
91-
app_profile_id=table.app_profile_id,
92-
retry=None,
93-
)
91+
self._target = target
92+
self._gapic_fn = gapic_client.mutate_rows
9493
# create predicate for determining which errors are retryable
9594
self.is_retryable = retries.if_exception_type(
9695
# RPC level errors
@@ -173,8 +172,12 @@ async def _run_attempt(self):
173172
# make gapic request
174173
try:
175174
result_generator = await self._gapic_fn(
175+
request=types_pb.MutateRowsRequest(
176+
entries=request_entries,
177+
app_profile_id=self._target.app_profile_id,
178+
**self._target._request_path,
179+
),
176180
timeout=next(self.timeout_generator),
177-
entries=request_entries,
178181
retry=None,
179182
)
180183
async for result_list in result_generator:

0 commit comments

Comments
 (0)