From 606c37dca65ff387eec64e788cd91e77ce3cc236 Mon Sep 17 00:00:00 2001 From: Jeremy Cohen Date: Tue, 6 Jul 2021 21:07:59 -0400 Subject: [PATCH] Upgrade dbt v0.20, dbt-utils v0.7 (#104) * Upgrade dbt v0.20, dbt-utils v0.7 * Update version, company name --- .circleci/config.yml | 2 +- README.md | 4 ++-- dbt_project.yml | 4 ++-- macros/adapters/_get_snowplow_namespaces.sql | 4 ---- macros/adapters/convert_timezone.sql | 3 +-- macros/adapters/get_start_ts.sql | 2 +- macros/adapters/is_adapter.sql | 2 +- macros/adapters/timestamp_ntz.sql | 2 +- packages.yml | 4 ++-- 9 files changed, 11 insertions(+), 16 deletions(-) delete mode 100644 macros/adapters/_get_snowplow_namespaces.sql diff --git a/.circleci/config.yml b/.circleci/config.yml index 21dba85..0ea999f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ jobs: python3 -m venv venv . venv/bin/activate pip install --upgrade pip setuptools - pip install dbt + pip install --pre dbt mkdir -p ~/.dbt cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml diff --git a/README.md b/README.md index 3607f51..ea44eb5 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ For specific implementation details: * [Android trackers](https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/android-tracker/) ## Installation Instructions -Check [dbt Hub](https://hub.getdbt.com/fishtown-analytics/snowplow/latest/) for +Check [dbt Hub](https://hub.getdbt.com/dbt-labs/snowplow/latest/) for the latest installation instructions, or [read the docs](https://docs.getdbt.com/docs/package-management) for more information on installing packages. @@ -89,7 +89,7 @@ Core: * Postgres Plugins: -* Spark (via [`spark_utils`](https://github.com/fishtown-analytics/spark-utils)) +* Spark (via [`spark_utils`](https://github.com/dbt-labs/spark-utils)) ### Contributions ### diff --git a/dbt_project.yml b/dbt_project.yml index bf4839b..9c95fbc 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,7 +1,7 @@ #settings specifically for this models directory #config other dbt settings within ~/.dbt/profiles.yml name: 'snowplow' -version: '0.12.0' +version: '0.13.0' config-version: 2 source-paths: ["models"] @@ -12,7 +12,7 @@ analysis-paths: ["analysis"] data-paths: ["data"] macro-paths: ["macros"] -require-dbt-version: ">=0.18.0" +require-dbt-version: ">=0.20.0" vars: #'snowplow:events': TABLE OR {{ REF() }} diff --git a/macros/adapters/_get_snowplow_namespaces.sql b/macros/adapters/_get_snowplow_namespaces.sql deleted file mode 100644 index ca7486d..0000000 --- a/macros/adapters/_get_snowplow_namespaces.sql +++ /dev/null @@ -1,4 +0,0 @@ -{% macro _get_snowplow_namespaces() %} - {% set override_namespaces = var('snowplow_dispatch_list', []) %} - {% do return(override_namespaces + ['snowplow']) %} -{% endmacro %} diff --git a/macros/adapters/convert_timezone.sql b/macros/adapters/convert_timezone.sql index 3d9da85..23fcf28 100644 --- a/macros/adapters/convert_timezone.sql +++ b/macros/adapters/convert_timezone.sql @@ -1,6 +1,5 @@ {%- macro convert_timezone(in_tz, out_tz, in_timestamp) -%} - {{ adapter.dispatch('convert_timezone', packages = snowplow._get_snowplow_namespaces()) - (in_tz, out_tz, in_timestamp) }} + {{ adapter.dispatch('convert_timezone', 'snowplow')(in_tz, out_tz, in_timestamp) }} {%- endmacro -%} {% macro default__convert_timezone(in_tz, out_tz, in_timestamp) %} diff --git a/macros/adapters/get_start_ts.sql b/macros/adapters/get_start_ts.sql index 887b2cf..8426849 100644 --- a/macros/adapters/get_start_ts.sql +++ b/macros/adapters/get_start_ts.sql @@ -29,7 +29,7 @@ {%- macro get_start_ts(relation, field = 'collector_tstamp') -%} - {{ adapter.dispatch('get_start_ts', packages = snowplow._get_snowplow_namespaces())(relation, field) }} + {{ adapter.dispatch('get_start_ts', 'snowplow')(relation, field) }} {%- endmacro -%} diff --git a/macros/adapters/is_adapter.sql b/macros/adapters/is_adapter.sql index ec7e100..6c29c88 100644 --- a/macros/adapters/is_adapter.sql +++ b/macros/adapters/is_adapter.sql @@ -1,6 +1,6 @@ {% macro is_adapter(adapter_type='default') %} - {{ return(adapter.dispatch('is_adapter', packages = snowplow._get_snowplow_namespaces()) (adapter_type)) }} + {{ return(adapter.dispatch('is_adapter', 'snowplow') (adapter_type)) }} {% endmacro %} diff --git a/macros/adapters/timestamp_ntz.sql b/macros/adapters/timestamp_ntz.sql index 381ea63..9989a9a 100644 --- a/macros/adapters/timestamp_ntz.sql +++ b/macros/adapters/timestamp_ntz.sql @@ -1,5 +1,5 @@ {% macro timestamp_ntz(field) %} - {{ adapter.dispatch('timestamp_ntz', packages = snowplow._get_snowplow_namespaces()) (field) }} + {{ adapter.dispatch('timestamp_ntz', 'snowplow') (field) }} {% endmacro %} {% macro default__timestamp_ntz(field) %} diff --git a/packages.yml b/packages.yml index 2246ac8..5302a1f 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - - package: fishtown-analytics/dbt_utils - version: [">=0.6.0", "<0.7.0"] + - package: dbt-labs/dbt_utils + version: [">=0.7.0", "<0.8.0"]