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

Commit 0b3606f

Browse files
chore: add user agent suffix (#842)
1 parent 0323dde commit 0b3606f

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def __init__(
122122
BigtableClientMeta._transport_registry[transport_str] = transport
123123
# set up client info headers for veneer library
124124
client_info = DEFAULT_CLIENT_INFO
125-
client_info.client_library_version = client_info.gapic_version
125+
client_info.client_library_version = self._client_version()
126126
# parse client options
127127
if type(client_options) is dict:
128128
client_options = client_options_lib.from_dict(client_options)
@@ -163,6 +163,13 @@ def __init__(
163163
stacklevel=2,
164164
)
165165

166+
@staticmethod
167+
def _client_version() -> str:
168+
"""
169+
Helper function to return the client version string for this client
170+
"""
171+
return f"{google.cloud.bigtable.__version__}-data-async"
172+
166173
def _start_background_channel_refresh(self) -> None:
167174
"""
168175
Starts a background task to ping and warm each channel in the pool

tests/unit/data/_async/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from mock import AsyncMock # type: ignore
4040

4141
VENEER_HEADER_REGEX = re.compile(
42-
r"gapic\/[0-9]+\.[\w.-]+ gax\/[0-9]+\.[\w.-]+ gccl\/[0-9]+\.[\w.-]+ gl-python\/[0-9]+\.[\w.-]+ grpc\/[0-9]+\.[\w.-]+"
42+
r"gapic\/[0-9]+\.[\w.-]+ gax\/[0-9]+\.[\w.-]+ gccl\/[0-9]+\.[\w.-]+-data-async gl-python\/[0-9]+\.[\w.-]+ grpc\/[0-9]+\.[\w.-]+"
4343
)
4444

4545

0 commit comments

Comments
 (0)