-
Notifications
You must be signed in to change notification settings - Fork 149
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
Is ckanext-dcat intended to work with DataStore (scheming KeyError)? #305
Comments
Looks like ckanext-scheming does some validation with the 'extras' field, but ckanext-dcat gets rid of that field. We were able to patch the problem by adding a try-except block around lines 283-289 in ckanext-scheming/ckanext/scheming/plugins.py, as follows:
Probably not the most graceful fix, but if there's no 'extras' field then that chunk of code won't be doing anything anyways. |
@eldobbins thanks for the detailed report
Yes, absolutely. Ckanext-dcat should work perfectly fine alongside datastore and datapusher/xloader/etc. If it doesn't it's a bug I managed to reproduce it on my end. Took me a while as I didn't realize I was running CKAN 2.11 as opposed to 2.10 as you reported, so that's a good clue. Let me investigate a bit more.
Really love the sound of this, maybe I'll start using it! |
In some situations like when validating an already validated dataset we might be missing the `extras` key. See ckan/ckanext-dcat#305 ckan/ckan#7571
I tracked down the issue to this patch ckan/ckan#7571 not being backported to CKAN 2.10. This is now backported so the next 2.10 patch release (and the Docker images that will get updated with it) will include the patch and fix this issue. In parallel I also sent a PR to ckanext-scheming with a fix similar to @jematson 's one for good measure. That should also be in the next scheming release. In the meantime you can apply the patch manually. |
We are developing a small catalog and have plans to include both DataStore uploads for table views and DCAT metadata fields. However, we can't seem to have both simultaneously.
I am running CKAN 2.10 installed with ckan-docker on a local machine (http://localhost:5000).
My machine:
Linux shell 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
but same problem on Windows.The plugin set-up from ckan.ini is copied from the dcat docs:
The error happens when I attempt to upload a resource (small CSV file) to DataStore using the button in the GUI catalog. It works fine if we upload the CSV using the API. The traceback of the docker container is:
Apologies for the interleaved messages from the various containers. Looks to me like scheming kaks because of a missing field
extras
which then causes datapusher to fail, which then triggers a 500 error within the catalog. Can I avoid this error with a different set of options?Thanks,
Liz
The text was updated successfully, but these errors were encountered: