Add an emissions 1990 query validation spec #1769
Open
louispt1 wants to merge 1 commit into
Open
Conversation
…ns.rb to validate the totals queries align with actual csv data to ensure no queries are missed when adding aggregates
Member
|
The functionality of the test works well! I have one suggestion regarding the nr of validated datasets. The purpose of the test is to check whether all EMISSIONS() rows are included in the co2, other_ghg and total_ghg queries. It is currently tested for all country datasets, but just checking a few datasets would already suffice and will be faster. We could define a couple of datasets in Would it be possible to setup the spec up in a way to only test these few datasets? |
kndehaan
reviewed
Jun 18, 2026
| removal ? -value : value | ||
| end / 1000.0 | ||
|
|
||
| context "1990 inventory reconciliation for #{check[:total]}" do |
Member
There was a problem hiding this comment.
Suggested change
| context "1990 inventory reconciliation for #{check[:total]}" do | |
| context "1990 emission results for #{check[:total]}" do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
There was a desire within the direct emissions enhancements to check if the queried total emissions equals the sum of the emissions in the emissions.csv with separate sums for co2, other_ghg and total_ghg for 1990.
Implemented changes
Added another spec to lib/graph_data_validation/spec/validation/emissions.rb to validate the totals queries align with actual csv data to ensure no queries are missed when adding aggregates
@noracato I'm not sure how much to abstract here? The spec looks a little over the top, but it also feels extra to make another class to hold the logic. If you think that's the right approach I'm happy to extract an emissions_csv_reconciler class in the lib to clean up the spec.
Related
Checklist