Skip to content

Commit 700ebe3

Browse files
Merge branch 'main' into csm_2_instrumentation
2 parents ced3ee3 + d55998d commit 700ebe3

File tree

42 files changed

+1112
-656
lines changed

Some content is hidden

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

42 files changed

+1112
-656
lines changed

.librarian/generator-input/setup.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@
9494
packages=packages,
9595
install_requires=dependencies,
9696
extras_require=extras,
97-
scripts=[
98-
"scripts/fixup_bigtable_v2_keywords.py",
99-
"scripts/fixup_admin_v2_keywords.py",
100-
],
10197
python_requires=">=3.7",
10298
include_package_data=True,
10399
zip_safe=False,

.librarian/state.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:8e2c32496077054105bd06c54a59d6a6694287bc053588e24debe6da6920ad91
1+
image: us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:b8058df4c45e9a6e07f6b4d65b458d0d059241dd34c814f151c8bf6b89211209
22
libraries:
33
- id: google-cloud-bigtable
4-
version: 2.34.0
4+
version: 2.35.0
55
last_generated_commit: a17b84add8318f780fcc8a027815d5fee644b9f7
66
apis:
77
- path: google/bigtable/v2

CHANGELOG.md

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

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

7+
## [2.35.0](https://github.com/googleapis/python-bigtable/compare/v2.34.0...v2.35.0) (2025-12-16)
8+
9+
10+
### Features
11+
12+
* support mTLS certificates when available (#1249) ([ca20219cf45305de25dfb715f69dd63bce9981b7](https://github.com/googleapis/python-bigtable/commit/ca20219cf45305de25dfb715f69dd63bce9981b7))
13+
* add basic interceptor to client (#1206) ([6561cfac605ba7c5b3f750c3bdca9108e517ba77](https://github.com/googleapis/python-bigtable/commit/6561cfac605ba7c5b3f750c3bdca9108e517ba77))
14+
* add PeerInfo proto in Bigtable API ([72dfdc440c22db0f4c372e6f11a9f7dc83fed350](https://github.com/googleapis/python-bigtable/commit/72dfdc440c22db0f4c372e6f11a9f7dc83fed350))
15+
* Add Type API updates needed to support structured keys in materialized views ([72dfdc440c22db0f4c372e6f11a9f7dc83fed350](https://github.com/googleapis/python-bigtable/commit/72dfdc440c22db0f4c372e6f11a9f7dc83fed350))
16+
* Add encodings for STRUCT and the Timestamp type ([72dfdc440c22db0f4c372e6f11a9f7dc83fed350](https://github.com/googleapis/python-bigtable/commit/72dfdc440c22db0f4c372e6f11a9f7dc83fed350))
17+
18+
19+
### Bug Fixes
20+
21+
* async client uses fixed grace period (#1236) ([544db1cd7af876298b8637f495b6c7b2a0bcf16c](https://github.com/googleapis/python-bigtable/commit/544db1cd7af876298b8637f495b6c7b2a0bcf16c))
22+
* re-export AddToCell for consistency (#1241) ([2a5baf11d30dc383a7b48d5f43b6cbb6160782e3](https://github.com/googleapis/python-bigtable/commit/2a5baf11d30dc383a7b48d5f43b6cbb6160782e3))
23+
* retry cancelled errors (#1235) ([e3fd5d8668303db4ed35e9bf6be48b46954f9d67](https://github.com/googleapis/python-bigtable/commit/e3fd5d8668303db4ed35e9bf6be48b46954f9d67))
24+
* Add ReadRows/SampleRowKeys bindings for materialized views ([72dfdc440c22db0f4c372e6f11a9f7dc83fed350](https://github.com/googleapis/python-bigtable/commit/72dfdc440c22db0f4c372e6f11a9f7dc83fed350))
25+
* Deprecate credentials_file argument ([72dfdc440c22db0f4c372e6f11a9f7dc83fed350](https://github.com/googleapis/python-bigtable/commit/72dfdc440c22db0f4c372e6f11a9f7dc83fed350))
26+
727
## [2.34.0](https://github.com/googleapis/python-bigtable/compare/v2.33.0...v2.34.0) (2025-10-16)
828

929

google/cloud/bigtable/data/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
from google.cloud.bigtable.data.mutations import Mutation
3333
from google.cloud.bigtable.data.mutations import RowMutationEntry
34+
from google.cloud.bigtable.data.mutations import AddToCell
3435
from google.cloud.bigtable.data.mutations import SetCell
3536
from google.cloud.bigtable.data.mutations import DeleteRangeFromColumn
3637
from google.cloud.bigtable.data.mutations import DeleteAllFromFamily
@@ -89,6 +90,7 @@
8990
"RowRange",
9091
"Mutation",
9192
"RowMutationEntry",
93+
"AddToCell",
9294
"SetCell",
9395
"DeleteRangeFromColumn",
9496
"DeleteAllFromFamily",

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
from google.api_core.exceptions import DeadlineExceeded
6060
from google.api_core.exceptions import ServiceUnavailable
6161
from google.api_core.exceptions import Aborted
62+
from google.api_core.exceptions import Cancelled
6263
from google.protobuf.message import Message
6364
from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper
6465

@@ -483,12 +484,11 @@ async def _manage_channel(
483484
old_channel = super_channel.swap_channel(new_channel)
484485
self._invalidate_channel_stubs()
485486
# give old_channel a chance to complete existing rpcs
486-
if CrossSync.is_async:
487-
await old_channel.close(grace_period)
488-
else:
489-
if grace_period:
490-
self._is_closed.wait(grace_period) # type: ignore
491-
old_channel.close() # type: ignore
487+
if grace_period:
488+
await CrossSync.event_wait(
489+
self._is_closed, grace_period, async_break_early=False
490+
)
491+
await old_channel.close()
492492
# subtract the time spent waiting for the channel to be replaced
493493
next_refresh = random.uniform(refresh_interval_min, refresh_interval_max)
494494
next_sleep = max(next_refresh - (time.monotonic() - start_timestamp), 0)
@@ -941,6 +941,7 @@ def __init__(
941941
DeadlineExceeded,
942942
ServiceUnavailable,
943943
Aborted,
944+
Cancelled,
944945
),
945946
default_mutate_rows_retryable_errors: Sequence[type[Exception]] = (
946947
DeadlineExceeded,

google/cloud/bigtable/data/_sync_autogen/client.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
from google.api_core.exceptions import DeadlineExceeded
5050
from google.api_core.exceptions import ServiceUnavailable
5151
from google.api_core.exceptions import Aborted
52+
from google.api_core.exceptions import Cancelled
5253
from google.protobuf.message import Message
5354
from google.protobuf.internal.enum_type_wrapper import EnumTypeWrapper
5455
import google.auth.credentials
@@ -367,7 +368,9 @@ def _manage_channel(
367368
old_channel = super_channel.swap_channel(new_channel)
368369
self._invalidate_channel_stubs()
369370
if grace_period:
370-
self._is_closed.wait(grace_period)
371+
CrossSync._Sync_Impl.event_wait(
372+
self._is_closed, grace_period, async_break_early=False
373+
)
371374
old_channel.close()
372375
next_refresh = random.uniform(refresh_interval_min, refresh_interval_max)
373376
next_sleep = max(next_refresh - (time.monotonic() - start_timestamp), 0)
@@ -732,6 +735,7 @@ def __init__(
732735
DeadlineExceeded,
733736
ServiceUnavailable,
734737
Aborted,
738+
Cancelled,
735739
),
736740
default_mutate_rows_retryable_errors: Sequence[type[Exception]] = (
737741
DeadlineExceeded,

google/cloud/bigtable/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.34.0" # {x-release-please-version}
16+
__version__ = "2.35.0" # {x-release-please-version}

google/cloud/bigtable_admin/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.34.0" # {x-release-please-version}
16+
__version__ = "2.35.0" # {x-release-please-version}

google/cloud/bigtable_admin_v2/__init__.py

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,18 @@
1515
#
1616
from google.cloud.bigtable_admin_v2 import gapic_version as package_version
1717

18+
import google.api_core as api_core
19+
import sys
20+
1821
__version__ = package_version.__version__
1922

23+
if sys.version_info >= (3, 8): # pragma: NO COVER
24+
from importlib import metadata
25+
else: # pragma: NO COVER
26+
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
27+
# this code path once we drop support for Python 3.7
28+
import importlib_metadata as metadata
29+
2030

2131
from .services.bigtable_instance_admin import BigtableInstanceAdminClient
2232
from .services.bigtable_instance_admin import BigtableInstanceAdminAsyncClient
@@ -143,6 +153,100 @@
143153
from .types.table import RestoreSourceType
144154
from .types.types import Type
145155

156+
if hasattr(api_core, "check_python_version") and hasattr(
157+
api_core, "check_dependency_versions"
158+
): # pragma: NO COVER
159+
api_core.check_python_version("google.cloud.bigtable_admin_v2") # type: ignore
160+
api_core.check_dependency_versions("google.cloud.bigtable_admin_v2") # type: ignore
161+
else: # pragma: NO COVER
162+
# An older version of api_core is installed which does not define the
163+
# functions above. We do equivalent checks manually.
164+
try:
165+
import warnings
166+
import sys
167+
168+
_py_version_str = sys.version.split()[0]
169+
_package_label = "google.cloud.bigtable_admin_v2"
170+
if sys.version_info < (3, 9):
171+
warnings.warn(
172+
"You are using a non-supported Python version "
173+
+ f"({_py_version_str}). Google will not post any further "
174+
+ f"updates to {_package_label} supporting this Python version. "
175+
+ "Please upgrade to the latest Python version, or at "
176+
+ f"least to Python 3.9, and then update {_package_label}.",
177+
FutureWarning,
178+
)
179+
if sys.version_info[:2] == (3, 9):
180+
warnings.warn(
181+
f"You are using a Python version ({_py_version_str}) "
182+
+ f"which Google will stop supporting in {_package_label} in "
183+
+ "January 2026. Please "
184+
+ "upgrade to the latest Python version, or at "
185+
+ "least to Python 3.10, before then, and "
186+
+ f"then update {_package_label}.",
187+
FutureWarning,
188+
)
189+
190+
def parse_version_to_tuple(version_string: str):
191+
"""Safely converts a semantic version string to a comparable tuple of integers.
192+
Example: "4.25.8" -> (4, 25, 8)
193+
Ignores non-numeric parts and handles common version formats.
194+
Args:
195+
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
196+
Returns:
197+
Tuple of integers for the parsed version string.
198+
"""
199+
parts = []
200+
for part in version_string.split("."):
201+
try:
202+
parts.append(int(part))
203+
except ValueError:
204+
# If it's a non-numeric part (e.g., '1.0.0b1' -> 'b1'), stop here.
205+
# This is a simplification compared to 'packaging.parse_version', but sufficient
206+
# for comparing strictly numeric semantic versions.
207+
break
208+
return tuple(parts)
209+
210+
def _get_version(dependency_name):
211+
try:
212+
version_string: str = metadata.version(dependency_name)
213+
parsed_version = parse_version_to_tuple(version_string)
214+
return (parsed_version, version_string)
215+
except Exception:
216+
# Catch exceptions from metadata.version() (e.g., PackageNotFoundError)
217+
# or errors during parse_version_to_tuple
218+
return (None, "--")
219+
220+
_dependency_package = "google.protobuf"
221+
_next_supported_version = "4.25.8"
222+
_next_supported_version_tuple = (4, 25, 8)
223+
_recommendation = " (we recommend 6.x)"
224+
(_version_used, _version_used_string) = _get_version(_dependency_package)
225+
if _version_used and _version_used < _next_supported_version_tuple:
226+
warnings.warn(
227+
f"Package {_package_label} depends on "
228+
+ f"{_dependency_package}, currently installed at version "
229+
+ f"{_version_used_string}. Future updates to "
230+
+ f"{_package_label} will require {_dependency_package} at "
231+
+ f"version {_next_supported_version} or higher{_recommendation}."
232+
+ " Please ensure "
233+
+ "that either (a) your Python environment doesn't pin the "
234+
+ f"version of {_dependency_package}, so that updates to "
235+
+ f"{_package_label} can require the higher version, or "
236+
+ "(b) you manually update your Python environment to use at "
237+
+ f"least version {_next_supported_version} of "
238+
+ f"{_dependency_package}.",
239+
FutureWarning,
240+
)
241+
except Exception:
242+
warnings.warn(
243+
"Could not determine the version of Python "
244+
+ "currently being used. To continue receiving "
245+
+ "updates for {_package_label}, ensure you are "
246+
+ "using a supported version of Python; see "
247+
+ "https://devguide.python.org/versions/"
248+
)
249+
146250
__all__ = (
147251
"BaseBigtableTableAdminAsyncClient",
148252
"BigtableInstanceAdminAsyncClient",

google/cloud/bigtable_admin_v2/gapic_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
__version__ = "2.34.0" # {x-release-please-version}
16+
__version__ = "2.35.0" # {x-release-please-version}

0 commit comments

Comments
 (0)