File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
src/google/adk/tools/bigquery
tests/unittests/tools/bigquery Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 18
18
from google .cloud import bigquery
19
19
from google .oauth2 .credentials import Credentials
20
20
21
- USER_AGENT = "adk-bigquery-tool"
21
+ from ... import version
22
+
23
+ USER_AGENT = f"adk-bigquery-tool google-adk/{ version .__version__ } "
22
24
23
25
24
26
def get_bigquery_client (
Original file line number Diff line number Diff line change 14
14
from __future__ import annotations
15
15
16
16
import os
17
+ import re
17
18
from unittest import mock
18
19
19
20
from google .adk.tools .bigquery .client import get_bigquery_client
@@ -122,4 +123,7 @@ def test_bigquery_client_user_agent():
122
123
# Verify that the tracking user agent was set
123
124
client_info_arg = mock_connection .call_args [1 ].get ("client_info" )
124
125
assert client_info_arg is not None
125
- assert client_info_arg .user_agent == "adk-bigquery-tool"
126
+ assert re .search (
127
+ r"adk-bigquery-tool google-adk/([0-9A-Za-z._\-+/]+)" ,
128
+ client_info_arg .user_agent ,
129
+ )
You can’t perform that action at this time.
0 commit comments