Errors flagged in check_headers, about the metadata headers not matching headers_config.yaml, are easy to miss. They don't appear in the error summary at the bottom of the logs, because they're a code error, not a validation error. This can be easy to miss if your terminal is small, so you may not even know there's an error.
Options to fix this:
- Add a return statement if the error is triggered, to stop the program
- Create a ValidationError instance for this and record it in process.py, then append it to the errors list for printout in the summary
I would recommend a return statement, because it's not a validation error and the code changes would be simpler. It does mean you can't ignore it, though, which is less convenient.
Example of the error in a log:
(od2_venv) PS C:\Users\colesh\Desktop\work\od2_md_scripts> python process.py uo-athletics
INFO: metadata file path
\\libfiles.uoregon.edu\DigitalProjects\Metadata\uo-athletics\Work\__processing\20260610_NCAA_Championships_TnF\20260610_NCAA_Championships_TnF.csv
INFO: assets file path
\\libfiles.uoregon.edu\DigitalProjects\Metadata\uo-athletics\Work\__processing\20260610_NCAA_Championships_TnF\files
INFO: check headers configuration / headers in metadata
ERROR: headers_config != metadata headers
INFO: metadata headers not in config file:
ERROR: dmrec
ERROR: update metadata headers and/or headers_config and retry
INFO: Validating {} from global
INFO: NO VALIDATION CHECK CONFIGURED FOR 'dmrec' in headers_config or default
INFO: Validating 'file' from config...
INFO: Validating 'identifier' from config...
INFO: NO VALIDATION CHECK CONFIGURED FOR 'title' in headers_config or default
INFO: NO VALIDATION CHECK CONFIGURED FOR 'description' in headers_config or default
INFO: Validating 'local_collection_name' from config...
INFO: Validating 'local_collection_id' from config...
INFO: Validating 'photographer' from config...
INFO: Validating 'date' from config...
INFO: Validating 'subject' from config...
INFO: Validating 'location' from config...
INFO: Validating 'resource_type' from config...
INFO: Validating 'format' from config...
INFO: Validating 'rights_statement' from config...
INFO: Validating 'license' from config...
INFO: Validating 'rights_holder' from config...
INFO: Validating 'parents' from config...
INFO: Validating 'institution' from config...
INFO: Validating 'model' from config...
INFO: Validating 'has_finding_aid' from config...
INFO: Validating 'visibility' from config...
INFO: Validating 'repository' from config...
INFO: Validating 'full_size_download_allowed' from config...
================================================================================
-- Validation complete --
Checked 23 headers
NO ERRORS FOUND
================================================================================
Errors flagged in check_headers, about the metadata headers not matching headers_config.yaml, are easy to miss. They don't appear in the error summary at the bottom of the logs, because they're a code error, not a validation error. This can be easy to miss if your terminal is small, so you may not even know there's an error.
Options to fix this:
I would recommend a return statement, because it's not a validation error and the code changes would be simpler. It does mean you can't ignore it, though, which is less convenient.
Example of the error in a log: