feat: Input validation with Dutch error messages and CI/CD#9
Merged
Conversation
- Add R/validation.R with validate_enrollments_input(), validate_rio_input(), and validate_data_types() - Integrate validation into audit_enrollments() and audit_rio() - Create comprehensive test suite (17 tests for validation, 2 for audit integration) - Add GitHub Actions workflows for R-CMD-check and test-coverage - Use structured rlang::abort() with informative Dutch error messages - All 145 tests passing Closes #4
- Add raw data validation before column translation - Add strict NA check for INS_Studentnummer (max 5% NA allowed) - Remove test output files and add to .gitignore - Shorten mapping table filenames to fix non-portable path errors - Use utils::head() to avoid NAMESPACE warnings - All 145 tests passing Renamed mapping files (keeping Mapping_ prefix): - Mapping_INS_Indicatie_eerste_jaars_opleiding_en_instelling... → Mapping_INS_ind_ej_opl_inst_naam.csv - Mapping_INS_Indicatie_eerste_jaars_instelling...naam → Mapping_INS_ind_ej_inst_naam.csv - Mapping_INS_Indicatie_eerste_jaars_instelling...Cat → Mapping_INS_ind_ej_inst_cat.csv - Mapping_INS_Indicatie_actief_op_peildatum... → Mapping_INS_actief_peil_omschr.csv - Mapping_INS_Opleidingsfase_actueel... → Mapping_INS_opleidingsfase_naam.csv - Mapping_INS_Examenresultaat... → Mapping_INS_examenres_omschr.csv - Mapping_INS_Soort_inschrijving... → Mapping_INS_soort_inschr_cat.csv - Mapping_INS_Hoogste_vooropleiding... → Mapping_INS_hoogste_vooropl_cat.csv - Mapping_INS_BaMa...gelijke_fase → Mapping_BaMa_Examen_gelijk_cohort.csv - Mapping_INS_BaMa...ongelijke_fase → Mapping_BaMa_Examen_ongelijk_cohort.csv
- Check all expected columns from Documentatie_ev.csv (In_gebruik=TRUE) are present in raw enrollments data (for datasets >= 10 columns) - For minimal test data (< 10 columns), only check critical columns - Provides detailed error message with missing column count and list - All 145 tests passing
- Error message now points users to cedanl/1cijferho tool - Explains data must be converted from ASCII to CSV with decoding - Includes GitHub link for the tool
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.
Summary
Changes
Validation (R/validation.R)
validate_enrollments_input()- validates enrollment data structure, required columns, year rangesvalidate_rio_input()- validates RIO data structure and required columnsvalidate_data_types()- validates column data typesrlang::abort()with informative Dutch error messagesIntegration (R/audit.R)
audit_enrollments()andaudit_rio()Tests
CI/CD Workflows
.github/workflows/R-CMD-check.yaml- Package checks on push/PR.github/workflows/test-coverage.yaml- Test coverage reportingTest plan
Closes #4