Skip to content

SCRUM-1159-adapters: get_dialect raises on an unrecognized connector - #329

Merged
marcociav-exmergo merged 2 commits into
mainfrom
SCRUM-1159-issue-319
Aug 19, 2026
Merged

SCRUM-1159-adapters: get_dialect raises on an unrecognized connector#329
marcociav-exmergo merged 2 commits into
mainfrom
SCRUM-1159-issue-319

Conversation

@emnarahmouni-exmergo

Copy link
Copy Markdown
Contributor

Closes : #319
The issue's proposal assumes explore query parses agent SQL without the connector's dialect, so a hyphen reads as subtraction under a generic/DuckDB parse. That's not what's happening here: explore query already resolves dialect get_dialect(connector) and threads it into every sqlglot call in the query firewall, and has done so since very early in the project, before the 1.6.3 the issue was filed against.

Verified through the real dispatch path, not just the parser in isolation, against a fake BigQuery client whose project id is itself
hyphenated:

```json {"status": "needs_confirmation", "data": {"command": "explore query", "per_table_bytes"{"myproject.my_dataset.my_table": 31457280.0, ...}, ...}} All three spellings the issue names reach needs_confirmation cleanly: my-project.my_dataset.my_table, `my-project`.`my_dataset`.`my_table`, and the bare unquoted form copied verbatim from an explore inventory identifier or explore query tables entry.

So this PR does not add a dialect= parameter anywhere, that's already there. If the reporter can still reproduce the original failure against a real BigQuery connection, the fix would be something else, most likely a connector-name mismatch (see below), and I'd want their exact command and .dex/config.yml connector value to find it.

What fixed :
One real gap: get_dialect() in adapters/init.py silently returned "duckdb" for any connector name it didn't recognize. That's exactly this failure mode waiting to happen — .dex/config.yml's connector field is a plain string with no enum validation, so a typo or an alias drift would silently parse every statement in the wrong dialect and produce this exact confusing error (a policy-refusal shape pointing at what looks like a SQL parser).

Before:

image

get_dialect("nonsense")
duckdb
After:

image

get_dialect("nonsense")
ValueError: unknown connector 'nonsense'get_dialect now raises the same way get_adapter already does for the same condition, so a connector-name mismatch fails loudly at the point it happens instead of quietly picking the wrong dialect.

@marcociav-exmergo
marcociav-exmergo merged commit 20a1ece into main Aug 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

explore query: a project-qualified BigQuery table name fails to parse on the hyphen in the project id

2 participants