Conversation
The LookML adapter stores dimension/measure SQL with {model} placeholders
(replacing ${TABLE}). The standard query rewriter handles this, but the
yardstick rewriter passed these directly to sqlglot.parse_one(), which
choked on the curly braces producing invalid SQL like {'_0': table.model}.
Fixes:
- Replace {model} in dimension SQL before parsing (5 call sites)
- Skip dimension expansion when resolved SQL is just table.column
(prevents unqualified outer references in correlation predicates)
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 856dd9cba1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if dimension_sql.lower() == f'{table_alias}.{column.name}'.lower(): | ||
| return None |
There was a problem hiding this comment.
Preserve alias-qualified dimensions for multi-model Yardstick
Returning None when a resolved dimension SQL is exactly <alias>.<column> leaves the original (often unqualified) column in place, but multi-model Yardstick context building skips unqualified group expressions (_build_yardstick_context_dimensions drops them when not tables and not single_model_scope). In joined semantic-model queries, a LookML dimension like {model}.region can therefore stop generating correlation predicates, causing AGGREGATE(...) subqueries to evaluate at the wrong grain (totals instead of per-dimension values).
Useful? React with 👍 / 👎.
The LookML adapter stores dimension/measure SQL with {model} placeholders (replacing ${TABLE}). The standard query rewriter handles this, but the yardstick rewriter passed these directly to sqlglot.parse_one(), which choked on the curly braces producing invalid SQL like {'_0': table.model}.
Fixes: