You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>
Copy file name to clipboardExpand all lines: docs/concepts/metrics/definition.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@ Because the `prod.users.country` and `prod.searches.num_searches` models have sp
59
59
60
60
Metrics can perform additional operations/calculations with other metrics.
61
61
62
-
In this example, the third metric `clicks_per_search` is calculated by dividing the first metric `total_searches` by the second metric `total_clicks`:
62
+
In this example, the third metric `clicks_per_search` is calculated by dividing `total_clicks` by `total_searches`:
63
63
64
64
```sql linenums="1"
65
65
METRIC (
@@ -78,6 +78,8 @@ METRIC (
78
78
);
79
79
```
80
80
81
+
Metric references are case insensitive, including quoted references, and may refer to metrics defined later in the project. Shared dependencies are resolved once during expansion. An unknown dependency or a dependency cycle raises a configuration error with the dependency chain and the path of the definition containing the invalid reference.
82
+
81
83
## Properties
82
84
83
85
The `METRIC` definition supports the following keys. The `name` and `expression` keys are required.
0 commit comments