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 check for validate_data consistency to validate-project CLI #367

Merged
merged 10 commits into from
Aug 16, 2024

Conversation

danielhuppmann
Copy link
Member

@danielhuppmann danielhuppmann commented Aug 13, 2024

This PR extends the validate-project CLI to check the consistency of all yaml files in the validate_data folder.

The error output is

Error(s) in files for DataValidator:
Collected 2 errors:
  1. In file data/validation/validate_data/validate_unknown_region.yaml:
  Collected 1 error:
    1. The following regions are not defined in the DataStructureDefinition:
       Asia

  2. In file data/validation/validate_data/validate_unknown_variable.yaml:
  Collected 1 error:
    1. The following variables are not defined in the DataStructureDefinition:
       Final Energy|Industry

Could be extended to clearly state the folder/type that is being checked in the first row...

@danielhuppmann danielhuppmann marked this pull request as ready for review August 13, 2024 06:45
@danielhuppmann
Copy link
Member Author

Reworked the error log message to be more concise:

Collected 2 errors when checking files for 'DataValidator' (validation/validate_data):
  1. Collected 1 error when checking in file 'validation/validate_data/validate_unknown_region.yaml':
    1. The following regions are not defined in the DataStructureDefinition:
       Asia

  2. Collected 1 error when checking in file 'validation/validate_data/validate_unknown_variable.yaml':
    1. The following variables are not defined in the DataStructureDefinition:
       Final Energy|Industry

Copy link
Contributor

@phackstock phackstock left a comment

Choose a reason for hiding this comment

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

Looks good to me, one small comment in line, after that good to merge

nomenclature/testing.py Outdated Show resolved Hide resolved
@danielhuppmann danielhuppmann merged commit 6efc8d9 into main Aug 16, 2024
12 checks passed
@danielhuppmann danielhuppmann deleted the feature/validate-data-cli branch August 16, 2024 07:46
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