-
Notifications
You must be signed in to change notification settings - Fork 41
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
Undo service_type
transformation in stg_rate_sheet_daily
and fix service_type
filters in cost_per_query
and hourly_spend
#151
Conversation
models/cost_per_query.sql
Outdated
@@ -188,10 +188,10 @@ inner join credits_billed_daily | |||
on date(all_queries.start_time) = credits_billed_daily.date | |||
left join {{ ref('daily_rates') }} as daily_rates | |||
on date(all_queries.start_time) = daily_rates.date | |||
and daily_rates.service_type = 'COMPUTE' | |||
and daily_rates.service_type = 'WAREHOUSE_METERING' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be CLOUD_SERVICES based on the data in daily rates
models/cost_per_query.sql
Outdated
and daily_rates.usage_type = 'cloud services' | ||
inner join {{ ref('daily_rates') }} as current_rates | ||
on current_rates.is_latest_rate | ||
and current_rates.service_type = 'COMPUTE' | ||
and current_rates.service_type = 'WAREHOUSE_METERING' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here - CLOUD_SERVICES
Thanks for your contribution @stumelius! This is included in release 5.1.0 :) |
This PR undoes the
CASE
statement that forced the daily rate sheetservice_type
to eitherSTORAGE
orCOMPUTE
instg_rate_sheet_daily
and fixes allservice_type
filters in the package accordingly.I cross referenced the hard-coded
service_type
values with snowflake.organization_usage.rate_sheet_daily, snowflake.account_usage.metering_history and snowflake.account_usage.metering_daily_history. I also did manual validation checks to ensure that the compute spend values are being populated in thedaily_spend
model.