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

Undo service_type transformation in stg_rate_sheet_daily and fix service_type filters in cost_per_query and hourly_spend #151

Merged

Conversation

stumelius
Copy link
Contributor

@stumelius stumelius commented Apr 3, 2024

This PR undoes the CASE statement that forced the daily rate sheet service_type to either STORAGE or COMPUTE in stg_rate_sheet_daily and fixes all service_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 the daily_spend model.

@@ -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'
Copy link

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

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'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here - CLOUD_SERVICES

@NiallRees NiallRees had a problem deploying to Approve Integration Tests May 6, 2024 16:38 — with GitHub Actions Failure
@NiallRees NiallRees had a problem deploying to Approve Integration Tests May 6, 2024 16:38 — with GitHub Actions Failure
@NiallRees NiallRees had a problem deploying to Approve Integration Tests May 6, 2024 16:42 — with GitHub Actions Failure
@NiallRees NiallRees had a problem deploying to Approve Integration Tests May 6, 2024 16:42 — with GitHub Actions Failure
@NiallRees NiallRees merged commit 46453d6 into get-select:main May 6, 2024
0 of 2 checks passed
@NiallRees
Copy link
Member

Thanks for your contribution @stumelius! This is included in release 5.1.0 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants