[ckan-dev] Datastore register "Null" for fields with value "0"
Dominik Moritz
dominik.moritz at okfn.org
Tue Jun 18 20:53:21 UTC 2013
Hi Jorge,
You found a bug in the datstorer. It should be fixed in [1]. Can you confirm this?
Thanks a lot for sending your report. It was really helpful!
Best wishes,
Dominik
[1] https://github.com/okfn/ckanext-datastorer/pull/45
On 18 Jun 2013, at 12:51, Jorge Pantoja <jorgepantojam at gmail.com> wrote:
> Hi Dominik, sorry for not answering your email soon.
>
> You can check this link for an example dataset I have:
> http://data.upf.edu/dataset/temporal-dataset
>
> You can check two files, one in xlsx and another in csv. For the file in
> csv, after the datastorer creates the api for this dataset, for the column
> "Data2" creates the data_type numeric and in the datapreview, the values
> for that column are null and not "0", therefore, for the api the same. You
> can download the csv file to check that the Data2 column values are "0".
>
> Thanks for your help,
>
>
> Jorge
>
>
>
>
> On Tue, Jun 11, 2013 at 10:27 PM, Dominik Moritz <dominik.moritz at okfn.org>wrote:
>
>> Hey Jorge,
>>
>> Can you show me an example?
>>
>> Cheers,
>> Dominik
>>
>> On 11 Jun 2013, at 00:30, Jorge Pantoja <jorgepantojam at gmail.com> wrote:
>>
>>> Hi Henrik,
>>>
>>> I didn’t do that, because I was using the datastorer to automatically add
>>> the files into the database. I will try to do the upload through the
>>> datastore API specifying the type of the field. However, using the
>>> datastorer, this still happens to me with the datasets that I want to
>>> upload.
>>>
>>>
>>> Thanks for your help,
>>>
>>>
>>> Jorge
>>>
>>>
>>>
>>>
>>> On Mon, Jun 10, 2013 at 3:31 PM, Henrik Korsgaard <
>> henrikkorsgaard at gmail.com
>>>> wrote:
>>>
>>>> Hi Jorge
>>>>
>>>> Did you set the type of each field when the dataset was created in the
>>>> datastore?, i.e. {"id":"some_name", "type":"int"}
>>>>
>>>> I had a similar experience where postgres 'casted' a string containing
>>>> numbers, e.g. "123" to an integer and then responded with an error if
>> the
>>>> record fields was "123d". I changed the fields of the dataset and
>> included
>>>> the type for every field, and now postgres is acting normal.
>>>>
>>>> Lesson learned - always set the type when creating dataset in datastore.
>>>>
>>>> -Henrik
>>>>
>>>>
>>>> On 10 June 2013 14:49, Jorge Pantoja <jorgepantojam at gmail.com> wrote:
>>>>
>>>>> Hi everyone,
>>>>>
>>>>> I was checking the datastore values for some datasets that I´ve added
>> and
>>>>> I noticed that for fields that have "0" as a value, are registered with
>>>>> Null. I’ve checked this with the API and in the postgres database. I´ve
>>>>> uploaded CSV and XLSX files. I’m using Ckan 2.0 (installation from
>> source).
>>>>>
>>>>> What might the problem be?
>>>>>
>>>>> Thanks again for your help,
>>>>>
>>>>>
>>>>> Jorge
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> ckan-dev mailing list
>>>>> ckan-dev at lists.okfn.org
>>>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>>>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Med venlig hilsen - Best regards,
>>>>
>>>> *Henrik Korsgaard*
>>>> Phone: +45 22377114
>>>> Office: CAVI 114b, Aarhus University
>>>>
>>>> NB. I am slowly migrating my university related correspondence to my
>>>> official AU mail: korsgaard at cavi.au.dk - feel free to contact me at
>> that
>>>> address if relevant.
>>>>
>>>> _______________________________________________
>>>> ckan-dev mailing list
>>>> ckan-dev at lists.okfn.org
>>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>>>>
>>>>
>>> _______________________________________________
>>> ckan-dev mailing list
>>> ckan-dev at lists.okfn.org
>>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>>
>> Dominik Moritz
>> CKAN developer | skype: d.moritz | @doobly_doo
>> The Open Knowledge Foundation
>> Empowering through Open Knowledge
>> http://okfn.org/ | @okfn | http://ckan.org | @CKANproject
>>
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
Dominik Moritz
CKAN developer | skype: d.moritz | @doobly_doo
The Open Knowledge Foundation
Empowering through Open Knowledge
http://okfn.org/ | @okfn | http://ckan.org | @CKANproject
More information about the ckan-dev
mailing list