From de9c099f2feaae7a20b4b49eb42c11f6a4345d60 Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 15 Jan 2024 15:48:16 -0500 Subject: [PATCH 1/2] Add handling for CLOUD_SERVICES service_type --- models/staging/stg_rate_sheet_daily.sql | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/models/staging/stg_rate_sheet_daily.sql b/models/staging/stg_rate_sheet_daily.sql index be876e8..460732d 100644 --- a/models/staging/stg_rate_sheet_daily.sql +++ b/models/staging/stg_rate_sheet_daily.sql @@ -13,10 +13,12 @@ select currency, effective_rate, case - -- Have only seen this on one account. Normally it is COMPUTE, and all our downstream models rely on that - -- May adjust this in the future if Snowflake is permanently changing these fields for all accounts - when service_type = 'WAREHOUSE_METERING' then 'COMPUTE' - else service_type + -- For most Snowflake accounts, the service_type field is always COMPUTE or STORAGE + -- Have recently seen new values introduced for one account: WAREHOUSE_METERING and CLOUD_SERVICES + -- For now, we'll force these to either be COMPUTE or STORAGE since that's what the downstream models expect + -- May adjust this in the future if Snowflake is permanently changing these fields for all accounts and starts offering different credit rates per usage_type + when service_type = 'STORAGE' then 'STORAGE' + else 'COMPUTE' end as service_type from {{ source('snowflake_organization_usage', 'rate_sheet_daily') }} order by date From b25cdbbb1cb20aa04ea3ff12c519888b8b14af7c Mon Sep 17 00:00:00 2001 From: Ian Date: Mon, 15 Jan 2024 15:51:20 -0500 Subject: [PATCH 2/2] Add changelog --- .changes/5.0.2.md | 7 +++++++ CHANGELOG.md | 8 ++++++++ dbt_project.yml | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changes/5.0.2.md diff --git a/.changes/5.0.2.md b/.changes/5.0.2.md new file mode 100644 index 0000000..c1e8c62 --- /dev/null +++ b/.changes/5.0.2.md @@ -0,0 +1,7 @@ +## dbt-snowflake-monitoring 5.0.2 - January 15, 2024 + +### Fixes + +- Fix handling of service_type ([#143](https://github.com/get-select/dbt-snowflake-monitoring/pull/143)) + + diff --git a/CHANGELOG.md b/CHANGELOG.md index 90ff556..0ac1f46 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.0.2 - January 15, 2024 + +### Fixes + +- Fix handling of service_type ([#143](https://github.com/get-select/dbt-snowflake-monitoring/pull/143)) + + + ## dbt-snowflake-monitoring 5.0.1 - January 15, 2024 ### Fixes diff --git a/dbt_project.yml b/dbt_project.yml index 4a505d6..03538f3 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,5 +1,5 @@ name: 'dbt_snowflake_monitoring' -version: '5.0.1' +version: '5.0.2' config-version: 2 profile: dbt_snowflake_monitoring