From 025a2b5c0e7b5d8bfcb0d47b2a35a10962fd8d77 Mon Sep 17 00:00:00 2001 From: ZdenekSrotyr Date: Tue, 5 May 2026 16:27:48 +0200 Subject: [PATCH] fix(db): apply bq_query_timeout_ms to read-only reattach path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Devin Review on PR #181: caught that the original PR plumbed the new SET into the orchestrator's _remote_attach (rebuild path), the BqAccess factory (materialize path), and the standalone extractor — but missed the actual primary `agnes query --remote` request path: every read-only analytics-DB connection runs `_reattach_remote_extensions` in `src/db.py` on open, and that LOAD bigquery + ATTACH cycle was unconfigured. Without this commit, the very flow the PR was meant to fix — analyst queries hitting BQ views > 90s — would still 400 with the same Binder Error / Job ID wording, because the runtime LOAD bigquery happens here not in the orchestrator's rebuild path. Apply apply_bq_session_settings(conn) right after the BQ secret is created and before ATTACH, mirroring what every other PR site does. --- src/db.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/db.py b/src/db.py index 27617d7..2591244 100644 --- a/src/db.py +++ b/src/db.py @@ -614,6 +614,8 @@ def _reattach_remote_extensions( f"CREATE OR REPLACE SECRET {secret_name} " f"(TYPE bigquery, ACCESS_TOKEN '{escaped}')" ) + from connectors.bigquery.access import apply_bq_session_settings + apply_bq_session_settings(conn) conn.execute( f"ATTACH '{safe_url}' AS {alias} (TYPE {extension}, READ_ONLY)" )