Skip to content

Commit

Permalink
Merge pull request #240 from dbt-labs/adding-support-for-1.5
Browse files Browse the repository at this point in the history
Adding support for 1.5
  • Loading branch information
callum-mcdata authored Apr 27, 2023
2 parents a6dd144 + ebf9f24 commit f0bee25
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 203 deletions.
7 changes: 7 additions & 0 deletions .changes/unreleased/Breaking Changes-20230426-163623.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
kind: Breaking Changes
body: Adding support for dbt-core 1.5
time: 2023-04-26T16:36:23.710755-05:00
custom:
Author: callum-mcdata
Issue: "239"
PR: "240"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Include in your `package.yml`
```yaml
packages:
- package: dbt-labs/metrics
version: [">=1.4.0", "<1.5.0"]
version: [">=1.5.0", "<1.6.0"]
```
## Supported Adapters
Expand Down
3 changes: 2 additions & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ seed-paths: ["seeds"]
macro-paths: ["macros"]
snapshot-paths: ["snapshots"]

require-dbt-version: [">=1.4.0-a1", "<1.5.0"]
require-dbt-version: [">=1.5.0-a1", "<1.6.0"]
# require-dbt-version: [">=1.4.0-a1", "<1.5.0"]
# require-dbt-version: [">=1.3.0-a1", "<1.4.0"]

target-path: "target" # directory which will store compiled SQL files
Expand Down
28 changes: 14 additions & 14 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ pytest-dotenv
# git+https://github.com/dbt-labs/dbt-bigquery.git
# git+https://github.com/databricks/dbt-databricks.git

# Most recent release candidates
dbt-tests-adapter
dbt-core
dbt-redshift
dbt-snowflake
dbt-bigquery
dbt-databricks

# Most recent stable release
# dbt-tests-adapter==1.3.0
# dbt-core==1.3.0
# dbt-redshift==1.3.0
# dbt-snowflake==1.3.0
# dbt-bigquery==1.3.0
# dbt-databricks==1.3.0
# dbt-tests-adapter
# dbt-core
# dbt-redshift
# dbt-snowflake
# dbt-bigquery
# dbt-databricks

# Most recent release candidates
dbt-tests-adapter==1.5.0-rc1
dbt-core==1.5.0-rc1
dbt-redshift==1.5.0-rc1
dbt-snowflake==1.5.0-rc1
dbt-bigquery==1.5.0-rc1
# dbt-databricks==1.5.0-rc1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metrics:
period: month
filters:
- field: had_discount
operator: 'is'
operator: '='
value: 'true'
- field: order_country
operator: '='
Expand Down
10 changes: 9 additions & 1 deletion macros/calculate.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@
VARIABLE SETTING - Creating the metric tree and making sure metric list is a list!
############ -#}

{%- if execute %}
{% do exceptions.warn(
"WARNING: dbt_metrics is going to be deprecated in dbt-core 1.6 in \
July 2023 as part of the migration to MetricFlow. This package will \
continue to work with dbt-core 1.5 but a 1.6 version will not be \
released. If you have any questions, please join us in the #dbt-core-metrics in the dbt Community Slack") %}
{%- endif %}

{%- if metric_list is not iterable -%}
{%- set metric_list = [metric_list] -%}
{%- endif -%}
Expand Down Expand Up @@ -40,7 +48,7 @@

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

{%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%}
{# {%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%} #}

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

Expand Down
10 changes: 9 additions & 1 deletion macros/develop.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
{#- Need this here, since the actual ref is nested within loops/conditions: -#}
-- depends on: {{ ref(var('dbt_metrics_calendar_model', 'dbt_metrics_default_calendar')) }}

{%- if execute %}
{% do exceptions.warn(
"WARNING: dbt_metrics is going to be deprecated in dbt-core 1.6 in \
July 2023 as part of the migration to MetricFlow. This package will \
continue to work with dbt-core 1.5 but a 1.6 version will not be \
released. If you have any questions, please join us in the #dbt-core-metrics in the dbt Community Slack") %}
{%- endif %}

{% if not execute -%}
{%- do return("not execute") -%}
{%- endif %}
Expand Down Expand Up @@ -51,7 +59,7 @@

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

{%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%}
{# {%- do metrics.validate_metric_config(metrics_dictionary=metrics_dictionary) -%} #}

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

Expand Down
92 changes: 0 additions & 92 deletions tests/functional/invalid_configs/test_invalid_metric_config.py

This file was deleted.

This file was deleted.

0 comments on commit f0bee25

Please sign in to comment.