mirror of
https://github.com/encounter/adk-python.git
synced 2026-07-09 18:19:28 -07:00
chore: add google-adk/{version} to bigquery user agent
PiperOrigin-RevId: 772703504
This commit is contained in:
committed by
Copybara-Service
parent
5f89a469ec
commit
f9fa7841df
@@ -18,7 +18,9 @@ import google.api_core.client_info
|
||||
from google.cloud import bigquery
|
||||
from google.oauth2.credentials import Credentials
|
||||
|
||||
USER_AGENT = "adk-bigquery-tool"
|
||||
from ... import version
|
||||
|
||||
USER_AGENT = f"adk-bigquery-tool google-adk/{version.__version__}"
|
||||
|
||||
|
||||
def get_bigquery_client(
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import re
|
||||
from unittest import mock
|
||||
|
||||
from google.adk.tools.bigquery.client import get_bigquery_client
|
||||
@@ -122,4 +123,7 @@ def test_bigquery_client_user_agent():
|
||||
# Verify that the tracking user agent was set
|
||||
client_info_arg = mock_connection.call_args[1].get("client_info")
|
||||
assert client_info_arg is not None
|
||||
assert client_info_arg.user_agent == "adk-bigquery-tool"
|
||||
assert re.search(
|
||||
r"adk-bigquery-tool google-adk/([0-9A-Za-z._\-+/]+)",
|
||||
client_info_arg.user_agent,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user