forked from dbt-labs/dbt-project-evaluator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dbt-labs#359 from dbt-labs/remove-metrics
update metric to new metric spec
- Loading branch information
Showing
18 changed files
with
112 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ dbt_modules/ | |
dbt_packages/ | ||
.vscode | ||
integration_tests/state/ | ||
site/ | ||
site/ | ||
.DS_Store |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
{{ ref('int_model_4') }} | ||
{{ ref('stg_model_1') }} | ||
-- {{ ref('int_model_4') }} | ||
-- {{ ref('stg_model_1') }} | ||
select 1 as id |
11 changes: 9 additions & 2 deletions
11
integration_tests/models/marts/intermediate/dim_model_7.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
{{ ref('stg_model_4') }} | ||
{{ ref('int_model_5') }} | ||
|
||
{{ | ||
config( | ||
materialized = 'table', | ||
) | ||
}} | ||
|
||
select * from {{ ref('stg_model_4') }} | ||
-- {{ ref('int_model_5') }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,37 @@ | ||
version: 2 | ||
|
||
metrics: | ||
- name: new_customers | ||
label: New Customers marked 'paying' | ||
model: ref('dim_model_7') | ||
description: "The number of paid customers using the product" | ||
|
||
calculation_method: count | ||
expression: user_id # superfluous here, but shown as an example | ||
semantic_models: | ||
- name: my_model | ||
model: ref('dim_model_7') | ||
description: "Transaction fact table at the transaction level. This table contains one row per transaction and includes the transaction timestamp." | ||
defaults: | ||
agg_time_dimension: date_day | ||
|
||
entities: # Entities included in the table are defined here. MetricFlow will use these columns as join keys. | ||
- name: dim | ||
type: primary | ||
expr: id | ||
|
||
timestamp: signup_date | ||
time_grains: [day, week, month] | ||
dimensions: # dimensions are qualitative values such as names, dates, or geographical data. They provide context to metrics and allow "metric by group" data slicing. | ||
- name: id | ||
type: categorical | ||
|
||
dimensions: | ||
- plan | ||
- country | ||
- name: date_day | ||
type: time | ||
type_params: | ||
time_granularity: day | ||
|
||
filters: | ||
- field: is_paying | ||
operator: '=' | ||
value: 'true' | ||
- field: company_name | ||
operator: '!=' | ||
value: "Acme', Inc" | ||
measures: # Measures are columns we perform an aggregation over. Measures are inputs to metrics. | ||
- name: total_count | ||
description: "The total count." | ||
agg: count | ||
expr: 1 | ||
|
||
meta: | ||
team: "Finance" | ||
refresh_rate: "Bob's weekly run" | ||
metrics: | ||
- name: new_metric | ||
label: "New Metric" | ||
type: simple | ||
type_params: | ||
# Specify the measure you are creating a proxy for. | ||
measure: total_count |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
models: | ||
- name: metricflow_time_spine | ||
description: default time spine for metricflow | ||
columns: | ||
- name: date_day | ||
tests: | ||
- unique | ||
- not_null |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- metricflow_time_spine.sql | ||
{% set date_expr = "current_date()" if target.type in ["duckdb"] else dbt.current_timestamp() %} | ||
{{ | ||
config( | ||
materialized = 'table', | ||
) | ||
}} | ||
|
||
with days as ( | ||
|
||
{{ | ||
dbt_utils.date_spine( | ||
'day', | ||
date_expr, | ||
dbt.dateadd('day', 1, date_expr), | ||
) | ||
}} | ||
|
||
), | ||
|
||
final as ( | ||
select cast(date_day as date) as date_day | ||
from days | ||
) | ||
|
||
select * from final |
2 changes: 1 addition & 1 deletion
2
integration_tests/seeds/docs/test_fct_documentation_coverage.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
total_models,documented_models,documentation_coverage_pct,staging_documentation_coverage_pct,intermediate_documentation_coverage_pct,marts_documentation_coverage_pct,other_documentation_coverage_pct | ||
14,3,21.43,20.00,0.00,0.00,66.67 | ||
15,4,26.67,20.00,0.00,0.00,75.00 |
2 changes: 1 addition & 1 deletion
2
integration_tests/seeds/performance/test_fct_exposure_parents_materializations.csv
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
parent_resource_type,parent_resource_name,exposure_name,parent_model_materialization | ||
model,dim_model_7,exposure_1,ephemeral | ||
model,fct_model_9,exposure_1,ephemeral | ||
source,source_1.table_1,exposure_1, |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
total_models,total_tests,tested_models,test_coverage_pct,staging_test_coverage_pct,intermediate_test_coverage_pct,marts_test_coverage_pct,other_test_coverage_pct,test_to_model_ratio | ||
14,11,5,35.71,80.00,50.00,0.00,0.00,0.7857 | ||
15,13,6,40.00,80.00,50.00,0.00,25.00,0.8667 |
This file contains 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
This file contains 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
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
This file contains 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