spraakbanken / karp-backend

Karp backend
MIT License
3 stars 2 forks source link

Resource dependency issues #273

Closed majsan closed 6 months ago

majsan commented 6 months ago

If resource A depends on resource B via the link-plugin, resource B must be created before A, otherwise we get the cryptic error:

AttributeError: 'list' object has no attribute 'items' (in karp.plugins.plugin._transform_fields)

Fix a better error message like: "Resource A depends on resource B, create resource B first".

nick8325 commented 6 months ago

The crash was caused by a bug in link_plugin :)

Now the behaviour is that the resource is created, but the virtual field will not appear in resource A until you run a karp-cli resource reindex. (I guess it would still be good to get a warning?)