Skip to content

Commit f0bee25

Browse files
Merge pull request #240 from dbt-labs/adding-support-for-1.5
Adding support for 1.5
2 parents a6dd144 + ebf9f24 commit f0bee25

9 files changed

Lines changed: 43 additions & 203 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
kind: Breaking Changes
2+
body: Adding support for dbt-core 1.5
3+
time: 2023-04-26T16:36:23.710755-05:00
4+
custom:
5+
Author: callum-mcdata
6+
Issue: "239"
7+
PR: "240"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Include in your `package.yml`
6262
```yaml
6363
packages:
6464
- package: dbt-labs/metrics
65-
version: [">=1.4.0", "<1.5.0"]
65+
version: [">=1.5.0", "<1.6.0"]
6666
```
6767
6868
## Supported Adapters

dbt_project.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ seed-paths: ["seeds"]
1919
macro-paths: ["macros"]
2020
snapshot-paths: ["snapshots"]
2121

22-
require-dbt-version: [">=1.4.0-a1", "<1.5.0"]
22+
require-dbt-version: [">=1.5.0-a1", "<1.6.0"]
23+
# require-dbt-version: [">=1.4.0-a1", "<1.5.0"]
2324
# require-dbt-version: [">=1.3.0-a1", "<1.4.0"]
2425

2526
target-path: "target" # directory which will store compiled SQL files

dev-requirements.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ pytest-dotenv
1010
# git+https://github.com/dbt-labs/dbt-bigquery.git
1111
# git+https://github.com/databricks/dbt-databricks.git
1212

13-
# Most recent release candidates
14-
dbt-tests-adapter
15-
dbt-core
16-
dbt-redshift
17-
dbt-snowflake
18-
dbt-bigquery
19-
dbt-databricks
20-
2113
# Most recent stable release
22-
# dbt-tests-adapter==1.3.0
23-
# dbt-core==1.3.0
24-
# dbt-redshift==1.3.0
25-
# dbt-snowflake==1.3.0
26-
# dbt-bigquery==1.3.0
27-
# dbt-databricks==1.3.0
14+
# dbt-tests-adapter
15+
# dbt-core
16+
# dbt-redshift
17+
# dbt-snowflake
18+
# dbt-bigquery
19+
# dbt-databricks
20+
21+
# Most recent release candidates
22+
dbt-tests-adapter==1.5.0-rc1
23+
dbt-core==1.5.0-rc1
24+
dbt-redshift==1.5.0-rc1
25+
dbt-snowflake==1.5.0-rc1
26+
dbt-bigquery==1.5.0-rc1
27+
# dbt-databricks==1.5.0-rc1

integration_tests/models/metric_definitions/base_count_distinct_metric.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ metrics:
1616
period: month
1717
filters:
1818
- field: had_discount
19-
operator: 'is'
19+
operator: '='
2020
value: 'true'
2121
- field: order_country
2222
operator: '='

macros/calculate.sql

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
VARIABLE SETTING - Creating the metric tree and making sure metric list is a list!
1212
############ -#}
1313

14+
{%- if execute %}
15+
{% do exceptions.warn(
16+
"WARNING: dbt_metrics is going to be deprecated in dbt-core 1.6 in \
17+
July 2023 as part of the migration to MetricFlow. This package will \
18+
continue to work with dbt-core 1.5 but a 1.6 version will not be \
19+
released. If you have any questions, please join us in the #dbt-core-metrics in the dbt Community Slack") %}
20+
{%- endif %}
21+
1422
{%- if metric_list is not iterable -%}
1523
{%- set metric_list = [metric_list] -%}
1624
{%- endif -%}
@@ -40,7 +48,7 @@
4048

4149
{%- do metrics.validate_dimension_list(dimensions=dimensions, metric_tree=metric_tree, metrics_dictionary=metrics_dictionary) -%}
4250

43-
{%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%}
51+
{# {%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%} #}
4452

4553
{%- do metrics.validate_where(where=where) -%}
4654

macros/develop.sql

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
{#- Need this here, since the actual ref is nested within loops/conditions: -#}
88
-- depends on: {{ ref(var('dbt_metrics_calendar_model', 'dbt_metrics_default_calendar')) }}
99

10+
{%- if execute %}
11+
{% do exceptions.warn(
12+
"WARNING: dbt_metrics is going to be deprecated in dbt-core 1.6 in \
13+
July 2023 as part of the migration to MetricFlow. This package will \
14+
continue to work with dbt-core 1.5 but a 1.6 version will not be \
15+
released. If you have any questions, please join us in the #dbt-core-metrics in the dbt Community Slack") %}
16+
{%- endif %}
17+
1018
{% if not execute -%}
1119
{%- do return("not execute") -%}
1220
{%- endif %}
@@ -51,7 +59,7 @@
5159

5260
{%- do metrics.validate_dimension_list(dimensions=dimensions, metric_tree=metric_tree, metrics_dictionary=metrics_dictionary) -%}
5361

54-
{%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%}
62+
{# {%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%} #}
5563

5664
{%- do metrics.validate_secondary_calculations(metric_tree=metric_tree, metrics_dictionary=metrics_dictionary, grain=grain, secondary_calculations=secondary_calculations) -%}
5765

tests/functional/invalid_configs/test_invalid_metric_config.py

Lines changed: 0 additions & 92 deletions
This file was deleted.

tests/functional/invalid_configs/test_invalid_metric_config_value.py

Lines changed: 0 additions & 92 deletions
This file was deleted.

0 commit comments

Comments
 (0)