From a70b1066a9c1fb31268c1b3f303f765765f0c63b Mon Sep 17 00:00:00 2001 From: Niall Woodward Date: Sun, 9 Jun 2024 17:32:52 -0700 Subject: [PATCH 1/2] Remove warehouse_cluster_status --- .../unreleased/Features-20240609-173247.yaml | 6 +++ models/warehouse_cluster_status.sql | 37 ------------------- models/warehouse_cluster_status.yml | 18 --------- 3 files changed, 6 insertions(+), 55 deletions(-) create mode 100644 .changes/unreleased/Features-20240609-173247.yaml delete mode 100644 models/warehouse_cluster_status.sql delete mode 100644 models/warehouse_cluster_status.yml diff --git a/.changes/unreleased/Features-20240609-173247.yaml b/.changes/unreleased/Features-20240609-173247.yaml new file mode 100644 index 0000000..d03008c --- /dev/null +++ b/.changes/unreleased/Features-20240609-173247.yaml @@ -0,0 +1,6 @@ +kind: Features +body: Remove warehouse_cluster_status model +time: 2024-06-09T17:32:47.794928-07:00 +custom: + Author: NiallRees + PR: "158" diff --git a/models/warehouse_cluster_status.sql b/models/warehouse_cluster_status.sql deleted file mode 100644 index a12da68..0000000 --- a/models/warehouse_cluster_status.sql +++ /dev/null @@ -1,37 +0,0 @@ -{{ config(materialized='table') }} - -with -stop_threshold as ( - select max(timestamp) as timestamp - from {{ ref('stg_warehouse_events_history') }} -), - -warehouse_cluster_status_base as ( - select - warehouse_id, - warehouse_name, - cluster_number, - timestamp as valid_from, - lead(timestamp) over (partition by warehouse_id, cluster_number order by timestamp asc) as valid_to, - event_name = 'RESUME_CLUSTER' as is_active - from {{ ref('stg_warehouse_events_history') }} - where - event_name in ('RESUME_CLUSTER', 'SUSPEND_CLUSTER') - and event_state = 'COMPLETED' -), - -warehouse_cluster_status as ( - select - warehouse_cluster_status_base.warehouse_id, - warehouse_cluster_status_base.warehouse_name, - warehouse_cluster_status_base.cluster_number, - warehouse_cluster_status_base.is_active, - warehouse_cluster_status_base.valid_from, - coalesce(warehouse_cluster_status_base.valid_to, stop_threshold.timestamp) as valid_to - from warehouse_cluster_status_base - cross join stop_threshold -) - -select * -from warehouse_cluster_status -order by valid_from diff --git a/models/warehouse_cluster_status.yml b/models/warehouse_cluster_status.yml deleted file mode 100644 index 61c1a95..0000000 --- a/models/warehouse_cluster_status.yml +++ /dev/null @@ -1,18 +0,0 @@ -version: 2 - -models: - - name: warehouse_cluster_status - description: This model tracks active periods for each cluster in a warehouse. It contains 1 row per warehouse-cluster period. - columns: - - name: warehouse_id - description: The unique warehouse ID (assigned by Snowflake) that corresponds to the warehouse name in your account. - - name: warehouse_name - description: The name of the warehouse in your account. - - name: cluster_number - description: The number of the cluster. For a single-cluster warehouse, this will always be 1. - - name: is_active - description: True if the cluster was running during the time period, otherwise False. - - name: valid_from - description: Timestamp for the beginning of the period. - - name: valid_to - description: Timestamp for the end of the period. From c572ec99e2d1d312303466afb79869eaf23e2e5f Mon Sep 17 00:00:00 2001 From: Niall Woodward Date: Sun, 9 Jun 2024 17:34:28 -0700 Subject: [PATCH 2/2] New release --- .changes/5.2.1.md | 7 +++++++ .changes/unreleased/Features-20240609-173247.yaml | 6 ------ CHANGELOG.md | 8 ++++++++ dbt_project.yml | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 .changes/5.2.1.md delete mode 100644 .changes/unreleased/Features-20240609-173247.yaml diff --git a/.changes/5.2.1.md b/.changes/5.2.1.md new file mode 100644 index 0000000..b55fd24 --- /dev/null +++ b/.changes/5.2.1.md @@ -0,0 +1,7 @@ +## dbt-snowflake-monitoring 5.2.1 - June 09, 2024 + +### Features + +- Remove warehouse_cluster_status model ([#158](https://github.com/get-select/dbt-snowflake-monitoring/pull/158)) + + diff --git a/.changes/unreleased/Features-20240609-173247.yaml b/.changes/unreleased/Features-20240609-173247.yaml deleted file mode 100644 index d03008c..0000000 --- a/.changes/unreleased/Features-20240609-173247.yaml +++ /dev/null @@ -1,6 +0,0 @@ -kind: Features -body: Remove warehouse_cluster_status model -time: 2024-06-09T17:32:47.794928-07:00 -custom: - Author: NiallRees - PR: "158" diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c06e8f..b237090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), and is generated by [Changie](https://github.com/miniscruff/changie). +## dbt-snowflake-monitoring 5.2.1 - June 09, 2024 + +### Features + +- Remove warehouse_cluster_status model ([#158](https://github.com/get-select/dbt-snowflake-monitoring/pull/158)) + + + ## dbt-snowflake-monitoring 5.2.0 - May 28, 2024 ### Features diff --git a/dbt_project.yml b/dbt_project.yml index a06cc4b..c203847 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'dbt_snowflake_monitoring' -version: '5.2.0' +version: '5.2.1' config-version: 2 profile: dbt_snowflake_monitoring