Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling for CLOUD_SERVICES service_type #143

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changes/5.0.2.md
Original file line number Diff line number Diff line change
@@ -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))


8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'dbt_snowflake_monitoring'
version: '5.0.1'
version: '5.0.2'
config-version: 2

profile: dbt_snowflake_monitoring
Expand Down
10 changes: 6 additions & 4 deletions models/staging/stg_rate_sheet_daily.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading