From 44cd6b00d4f4f35caf8f4739d0af275e27a7dfce Mon Sep 17 00:00:00 2001 From: Sanjana Sen Date: Fri, 19 Jun 2020 12:05:19 -0400 Subject: [PATCH 1/6] bump to 0.17.0 --- .github/ISSUE_TEMPLATE/CODEOWNERS | 1 + README.md | 5 ++++- dbt_project.yml | 5 ++++- integration_tests/dbt_project.yml | 4 ++-- packages.yml | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/CODEOWNERS diff --git a/.github/ISSUE_TEMPLATE/CODEOWNERS b/.github/ISSUE_TEMPLATE/CODEOWNERS new file mode 100644 index 0000000..3a5bf1e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/CODEOWNERS @@ -0,0 +1 @@ +* @clrcrl \ No newline at end of file diff --git a/README.md b/README.md index 1c15f7c..72813f6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ > this package, especially as a post-hook. Please consider if this package is > appropriate for your use case before using it. -Requires dbt >= 0.16.0 +Requires dbt >= 0.17.0 This package provides out-of-the-box functionality to log events for all dbt invocations, including run start, run end, model start, and model end. It @@ -63,3 +63,6 @@ New columns were added in v0.2.0: - **event_is_full_refresh as is_full_refresh** - `boolean` whether the DBT run was a full refresh These will be added to your existing audit table automatically in the `on-run-start` DBT hook, and added to the staging tables deployed by this table when they are ran. The existing `event_schema` column will also be propagated into to `stg_dbt_model_deployments` as `schema`. + +###Contributing +Additional contributions to this repo are very welcome! Check out [this](https://discourse.getdbt.com/t/contributing-to-an-external-dbt-package/657) post on the best workflow for contributing to a package. All PRs should only include functionality that is contained within all Segment deployments; no implementation-specific details should be included. diff --git a/dbt_project.yml b/dbt_project.yml index 53655cc..cc1ac1e 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,8 @@ name: 'logging' -version: '1.0' +version: '0.2.0' +config-version: 2 + +require-dbt-version: [">=0.17.0", "<0.18.0"] source-paths: ["models"] analysis-paths: ["analysis"] diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 93d90de..f6d7b3d 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,10 +1,10 @@ name: 'event_logging_integration_tests' -version: '1.0' +version: '0.2.0' +config-version: 2 profile: 'integration_tests' -require-dbt-version: ">=0.15.0" models: pre-hook: "{{ logging.log_model_start_event() }}" diff --git a/packages.yml b/packages.yml index de95e6c..e2afb74 100644 --- a/packages.yml +++ b/packages.yml @@ -1,3 +1,3 @@ packages: - package: fishtown-analytics/dbt_utils - version: [">=0.2.4", "<0.4.0"] + version: [">=0.2.4", "<0.5.0"] From 6e17d4d8d0d40282e9653230a2c58f5be60c0f6d Mon Sep 17 00:00:00 2001 From: Sanjana Sen Date: Sun, 21 Jun 2020 11:51:55 -0400 Subject: [PATCH 2/6] upgrade to 0-17-0 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a6801c1..56e9947 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ version: 2.1 jobs: build: docker: - - image: circleci/python:3.6.2-stretch + - image: circleci/python:3.6.3-stretch - image: circleci/postgres:9.6.5-alpine-ram steps: From 005cb9924e3d6361b7846c918fef39da2258aa31 Mon Sep 17 00:00:00 2001 From: Sanjana Sen Date: Sun, 21 Jun 2020 12:11:57 -0400 Subject: [PATCH 3/6] update project.yml --- dbt_project.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index cc1ac1e..6d2cf7e 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -2,7 +2,7 @@ name: 'logging' version: '0.2.0' config-version: 2 -require-dbt-version: [">=0.17.0", "<0.18.0"] +require-dbt-version: [">=0.17.0"] source-paths: ["models"] analysis-paths: ["analysis"] @@ -29,5 +29,4 @@ on-run-end: models: - logging: - schema: meta + +schema: meta From 3d98d91d3f30250f18b190d2ae9289dd3c93ae8a Mon Sep 17 00:00:00 2001 From: Sanjana Sen Date: Tue, 23 Jun 2020 15:35:47 -0400 Subject: [PATCH 4/6] fix python in circle ci config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 56e9947..67de75d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,7 +25,7 @@ jobs: . venv/bin/activate pip install --upgrade pip setuptools - pip install dbt==0.16.1 + pip install dbt mkdir -p ~/.dbt cp integration_tests/ci/sample.profiles.yml ~/.dbt/profiles.yml From dee0669b26d0eb130eb5b9d463fd1b0f154e3275 Mon Sep 17 00:00:00 2001 From: Sanjana Sen Date: Tue, 23 Jun 2020 15:41:08 -0400 Subject: [PATCH 5/6] make project.yml changes --- dbt_project.yml | 3 ++- integration_tests/dbt_project.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 6d2cf7e..e8c2ff5 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'logging' -version: '0.2.0' +version: '0.3.0' config-version: 2 require-dbt-version: [">=0.17.0"] @@ -29,4 +29,5 @@ on-run-end: models: + logging: +schema: meta diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index f6d7b3d..49fa72d 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,6 +1,6 @@ name: 'event_logging_integration_tests' -version: '0.2.0' +version: '0.3.0' config-version: 2 profile: 'integration_tests' From 66981626eca01f70fa8a168369e552ee6eaa46d7 Mon Sep 17 00:00:00 2001 From: Sanjana Sen Date: Tue, 23 Jun 2020 15:56:11 -0400 Subject: [PATCH 6/6] fix macro for failing ci --- integration_tests/macros/drop_audit_schema.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration_tests/macros/drop_audit_schema.sql b/integration_tests/macros/drop_audit_schema.sql index e63f121..9f9af83 100644 --- a/integration_tests/macros/drop_audit_schema.sql +++ b/integration_tests/macros/drop_audit_schema.sql @@ -2,7 +2,8 @@ {% set audit_schema=logging.get_audit_schema() %} {% if adapter.check_schema_exists(target.database, audit_schema) %} - {% do drop_schema(target.database, audit_schema) %} + {% set audit_schema_relation = api.Relation.create(database=target.database, schema=audit_schema).without_identifier() %} + {% do drop_schema(audit_schema_relation) %} {% do run_query("commit;") %} {{ dbt_utils.log_info("Audit schema dropped")}}