fix: preserve metric semantics across fact sources - #6029
Open
tchivs wants to merge 2 commits into
Open
Conversation
Resolve metric dependencies iteratively and report cycles or unknown references with their dependency chain and defining file. Preserve forward references, shared dependencies, and case-insensitive metric names with execution-based regression coverage. Signed-off-by: tchivs <topivn@live.cn>
Resolve complete predicates for every contributing fact before aggregation. Preserve full-join grouping keys, including NULL and composite keys, and retain outer SQL scope references. Use PostgreSQL-compatible composite equality for nullable grouping keys and add native model-to-query acceptance coverage. Reject unsupported query shapes explicitly while retaining the Metrics prototype status. Signed-off-by: tchivs <topivn@live.cn>
tchivs
force-pushed
the
feat/metrics-production
branch
from
September 5, 2026 09:44
c5f78f0 to
d8e1b00
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix correctness gaps in the existing Metrics prototype without introducing a separate semantic layer or serving API.
Dependency resolution
ConfigError, including the dependency chain and defining file.Query correctness
IS NOT DISTINCT FROMconditions.Replace implementation-level SQL snapshots/commented scenarios with executable result/error regressions, add native PostgreSQL model-to-query integration coverage, and document the repeatable acceptance procedure.
Scope and limitations
Test Plan
make style: passed (ruff, ruff-format, mypy, migration validation).make fast-test: passed after installing the missing local unixODBC runtime dependency:Context.rewrite, and executes the generated SQL on PostgreSQL. In-memory DuckDB is used only for isolated SQLMesh state, following the existing integration fixtures.Checklist
make styleand fixed any issuesmake fast-test)git commit -s) per the DCO