[ckan-dev] Dataset vocabulary tags deleted when adding resource

JD Bothma jd at openup.org.za
Wed Nov 14 05:19:35 UTC 2018


I've tracked this down to my vocabulary fields being empty in
validated_data_dict in solr after ckanext-extractor calls
ckan.lib.search.index_for('package').update_dict(pkg_dict) in its tasks.py
(as a background task) but present in data_dict and the root of the
document in solr.

These tag vocabulary fields works fine generally - if I set them using the
API or UI, they're present in validated_data_dict and work as expected.
It's just after update_index gets called from ckanextextractor that they
disappear.

They are present in pkg_dict before update_dict is called.

Could it be that they fail vaidation or that my show_package_schema is
broken or not even called?
https://github.com/OpenUpSA/ckanext-satreasury/blob/master/ckanext/satreasury/plugin.py#L111

In pkg_dict they look like  {... u'sphere': [u'national'],
u'financial_year': [u'2018-19'] ...}



On Tue, 30 Oct 2018 at 21:26, JD Bothma <jd at openup.org.za> wrote:

> I thought I was going crazy.
>
> I think I tracked it down to an oldish version of ckanext-extractor - I'll
> follow up there when I confirm -
> https://github.com/stadt-karlsruhe/ckanext-extractor/issues/16
>
> Still not sure why it's happening in production but not locally.
>
> I think this has been hidden in the past because I used a script that
> would update (and fix) the package each time I add a resource, and I
> generally add XLS resources after adding PDF resources to the same
> datasets, and I have extractor configured to only extract PDF resources.
>
> Best
> JD
>
> On Tue, 30 Oct 2018 at 20:52, JD Bothma <jd at openup.org.za> wrote:
>
>> I have a situation where vocabulary tags get removed from a dataset when
>> I add resources with resource_create.
>>
>> This only happens in production - I can't reproduce it locally.
>>
>> I can't tell what's different from how I used to create datasets and add
>> resources - this worked fine but recently this has shown up.
>>
>> It happens regardless of whether I create the resource immediately after
>> creating the dataset, or a few minutes after creating the dataset.
>>
>> Has anyone seen anything like this?
>>
>> --
>> JD Bothma
>> Software Developer
>> OpenUp
>> +27 (0)79 281 6737
>> +27 (0)21 671 6306
>>
>
>
> --
> JD Bothma
> Software Developer
> OpenUp
> +27 (0)79 281 6737
> +27 (0)21 671 6306
>


-- 
JD Bothma
Software Developer
OpenUp
+27 (0)79 281 6737
+27 (0)21 671 6306
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20181114/b9b215f4/attachment.html>


More information about the ckan-dev mailing list