Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion google/cloud/bigtable/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def __init__(
):
if client_info is None:
client_info = client_info_lib.ClientInfo(
client_library_version=bigtable.__version__,
client_library_version=f"{bigtable.__version__}-legacy",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about this a bit more, Lets leave the old agent the same in case there are dashboard that care about it. Instead have the new clients be suffixed with sync & async

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, reverted

)
if read_only and admin:
raise ValueError(
Expand Down
9 changes: 8 additions & 1 deletion google/cloud/bigtable/data/_async/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def __init__(
BigtableClientMeta._transport_registry[transport_str] = transport
# set up client info headers for veneer library
client_info = DEFAULT_CLIENT_INFO
client_info.client_library_version = client_info.gapic_version
client_info.client_library_version = self._client_version()
# parse client options
if type(client_options) is dict:
client_options = client_options_lib.from_dict(client_options)
Expand Down Expand Up @@ -162,6 +162,13 @@ def __init__(
stacklevel=2,
)

@staticmethod
def _client_version() -> str:
"""
Helper function to return the client version string for this client
"""
return f"{google.cloud.bigtable.__version__}-data-async"

def start_background_channel_refresh(self) -> None:
"""
Starts a background task to ping and warm each channel in the pool
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/data/_async/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from mock import AsyncMock # type: ignore

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


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/v2_client/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def test_client_constructor_defaults():
assert not client._read_only
assert not client._admin
assert isinstance(client._client_info, client_info.ClientInfo)
assert client._client_info.client_library_version == __version__
assert client._client_info.client_library_version == f"{__version__}-legacy"
assert client._channel is None
assert client._emulator_host is None
assert client.SCOPE == (DATA_SCOPE,)
Expand Down