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.
Description
When firing a document and event set of csvs at a locally deployed latest version of the backend with the latest production postgres db dump using the cclw ingest end point, the request fails.
This is as the metadata taxonomy values do not have allow_any values in the mapping. Here is an example after loading the latest production db state dump:
"topic":{"allow_blanks":true,"allowed_values":["Mitigation","Adaptation","Loss And Damage","Disaster Risk Management"]}
This is causing the following error during the cclw ingest:
An example for the UNFCCC can be seen below which does contain the allow_any value as true which explains why that ingest succeeded last week.
"author":{"allow_any":true,"allow_blanks":false,"allowed_values":[]}}
It would appear that during the tests the test database loads taxonomy values with allow_any for cclw. It is not entirely clear when this happens but logging during the tests proves that the the database does contain allow_any values for the cclw taxonomy.
Type of change
This PR updates the json object for the cclw taxonomy to include the allow_any field. From my understanding if we deploy the latest version of the backend and run the make migrations_docker_backend command this should load the updated taxonomy and thus allow the ingest to run successfully.
We then update the populate taxonomy module to identify if there is a difference between the declared taxonomy in code and that in the database and to update accordingly.
Please select the option(s) below that are most relevant:
How Has This Been Tested?
Extensive unit tests and running of the csv's locally against the endpoint.
Reviewer Checklist
Confirm that allow_any = False as default is correct?