From 8d88b2c3ad849b22e14a8d74185bfe348fd2503b Mon Sep 17 00:00:00 2001 From: "lukasz.lipinski@allegro.com" Date: Tue, 2 Dec 2025 13:36:58 +0100 Subject: [PATCH] Add location for table with agent events in plugin BigQueryAgentAnalytics --- src/google/adk/plugins/bigquery_agent_analytics_plugin.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/google/adk/plugins/bigquery_agent_analytics_plugin.py b/src/google/adk/plugins/bigquery_agent_analytics_plugin.py index 63b95e57ea..40c38e8604 100644 --- a/src/google/adk/plugins/bigquery_agent_analytics_plugin.py +++ b/src/google/adk/plugins/bigquery_agent_analytics_plugin.py @@ -321,6 +321,7 @@ def __init__( dataset_id: str, table_id: str = "agent_events", config: Optional[BigQueryLoggerConfig] = None, + location: str = "US", **kwargs, ): """Initializes the BigQueryAgentAnalyticsPlugin. @@ -338,6 +339,7 @@ def __init__( dataset_id, table_id, ) + self._location = location self._config = config if config else BigQueryLoggerConfig() self._bq_client: bigquery.Client | None = None self._write_client: BigQueryWriteAsyncClient | None = None @@ -458,7 +460,7 @@ async def _ensure_init(self): user_agent=f"google-adk-bq-logger/{version.__version__}" ) self._bq_client = bigquery.Client( - project=self._project_id, credentials=creds, client_info=client_info + project=self._project_id, credentials=creds, client_info=client_info, location=self._location ) # Ensure table exists (sync call in thread)