Skip to content

[2/2] Typed default values sql - #2736

Open
shangyian wants to merge 1 commit into
DataJunction:typed-default-valuesfrom
shangyian:typed-default-values-sql
Open

shangyian wants to merge 1 commit into
DataJunction:typed-default-valuesfrom
shangyian:typed-default-values-sql

Conversation

@shangyian

Copy link
Copy Markdown
Collaborator

Summary

Test Plan

  • PR has an associated issue: #
  • make check passes
  • make test shows 100% unit test coverage

Deployment Plan

@netlify

netlify Bot commented Nov 16, 2026

Copy link
Copy Markdown

👷 Deploy request for thriving-cassata-78ae72 pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit e1babb6

@shangyian shangyian changed the title Typed default values sql [2/2] Typed default values sql Nov 16, 2026
@shangyian
shangyian changed the base branch from main to typed-default-values November 16, 2026 02:28
@shangyian
shangyian marked this pull request as ready for review November 19, 2026 05:10
@greptile-apps

greptile-apps Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The PR changes SQL output for linked dimensions that configure fallback values.

Fix the missing defaults in single-node and pre-aggregated queries before merging.

Findings

  1. P1 Some queries drop defaults ▶

Summary

This PR applies per-type dimension defaults to generated SQL and deprecates the single-value setting.

  • Linked dimension columns use defaults that match their types.
  • Deployments warn when a join link uses the single-value fallback.

Reviews (1) · Last reviewed commit: "Use default_values when generating SQL f..." · Reviewed by Greptile

Comment on lines +1037 to +1041
default_literal = dimension_link_default_for_column(
default_value,
default_values,
column_type,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Some queries drop defaults. The new default_values path needs column_type, but build_dimension_col_expr only looks it up when callers pass ctx. Both the single-node query builder in node_query.py and the pre-aggregated query path omit that argument. A joined string column with default_values: {string: Unknown} therefore stays bare in /sql/{node} output and when a pre-aggregated table is joined back to the dimension. Unmatched rows return NULL instead of the configured default, unlike the source-built metric query. Pass ctx at both call sites and cover these paths in tests.

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.

1 participant