-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
Use case
The use case we have is to update the list of funders.
Current behaviour
In an instance e.g cds-rdm we hold a funder.yaml file with the following syntax:
- id: 00k4n6c32
country: BE
identifiers:
- identifier: 00k4n6c32
scheme: ror
name: European Commission
title:
en: European CommissionIf we add a new funder in the list and then we run the command invenio vocabularies update -v funders -f app_data/vocabularies.yaml then we get an error:
Traceback (most recent call last):
File "/usr/local/bin/invenio", line 8, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/flask/cli.py", line 357, in decorator
return __ctx.invoke(f, *args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.9/site-packages/invenio_vocabularies/cli.py", line 103, in update
for w_conf in config["writers"]:
KeyError: 'writers'The update works if you update the app_data/vocabularies.yaml as below:
funders:
pid-type: fun
data-file: updated_funders.yaml
readers:
- type: yaml
writers:
- type: funders-service
args:
update: TrueExpected solution
We should either fix the cli command to incorporate a more user friendly way of updating a vocabulary entry e.g identify if the data-file is a yaml and use the correct reader or indicate another way of updating or inserting entries in a vocabulary
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Backlog 😴