-
Notifications
You must be signed in to change notification settings - Fork 87
fix: coerce empty-string dialect to no-hint across native handlers (unknown dialect '' throw) #927
Description
Description
Pre-existing latent bug surfaced while wiring core 0.5.1 (#925 follow-up). altimate-core throws unknown dialect '' on an empty-string dialect. Several native handlers forward params.dialect ?? undefined, so a literal "" is passed through (empty string is not nullish) and the engine throws:
packages/opencode/src/altimate/native/altimate-core.ts:Schema.fromDdl(migration),columnLineage,formatSql,extractMetadata,compareQueries,importDdlpackages/opencode/src/altimate/native/sql/register.ts:columnLineage
In the dbt review pipeline these are protected today because review/run.ts resolves config.dialect (auto-detect → fallback "snowflake") before runReview. But any direct caller using the documented default (ReviewConfig.dialect = "") would hit the throw → caught → silent degradation (e.g., column-breakage/PII-via-lineage lanes return empty).
Fix
Normalize these sites to params.dialect || undefined (coerce ""/null/undefined → undefined), matching the convention already used in sql/register.ts:433-434 and the checkEquivalence sites hardened in the parent PR. No valid dialect is falsy, so the change is behavior-neutral except for eliminating the "" throw.
Context
Independently flagged by a consensus code-review model (Gemini) during the parent PR. Kept out of the parent PR for scope discipline (those sites are not 0.5.1 functionality).