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

Fix join clause on hourly_spend #175

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

fernandobrito
Copy link
Contributor

@fernandobrito fernandobrito commented Feb 11, 2025

The recent PR #173 introduced a new CTE on hourly_spend to fetch the spend from several services from metering_history and it also removed a few existing CTEs that would be covered by the new CTE.

The new CTE, however, lacked a clause on a JOIN, which caused the JOIN to fan out on cases when there are multiple rows in daily_rates for the same service (eg: for the AUTOMATIC_CLUSTERING service, there could be 2 rows with usage_type = 'automatic clustering' and usage_type = 'adjustment-automatic clustering').

This means that the previous release (5.4.0) caused hourly_spend to overreport spend for such services covered by the CTE.

This PR restores the extra clause on the JOIN that was present before to prevent this fan out.

@fernandobrito fernandobrito requested a deployment to Approve Integration Tests February 11, 2025 16:52 — with GitHub Actions Waiting
@fernandobrito fernandobrito deployed to Approve Integration Tests February 11, 2025 16:54 — with GitHub Actions Active
@fernandobrito fernandobrito merged commit cc1140f into main Feb 11, 2025
1 check passed
@fernandobrito fernandobrito deleted the increase-service-spend-coverage-2 branch February 11, 2025 17:06
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.

2 participants