[openspending-dev] API returning **** (asterisks) instead of an actual string

Tryggvi Björgvinsson tryggvi.bjorgvinsson at okfn.org
Mon Oct 21 17:00:24 UTC 2013


Hey Everton,

I looked at the sources for the dataset on the about page[1] and noticed
that the file from 2012[2] contains the asterisks you want to get rid
of. That's why they show up in OpenSpending.

[1]: http://openspending.org/orcamento_publico/meta
[2]: https://dl.dropboxusercontent.com/s/i2c51io4jyruvg2/2012-limpo.csv

On fim 17.okt 2013 04:05, Everton Zanella Alvarenga wrote:
> Hi all,
>
> I'm seeing a weird behavior when I have an API request with a dataset I'm
> working on. When I try to extract the subfuncao dimension with the id 608 (the
> request<http://openspending.org/api/2/search?q=&pagesize=100&format=json&dataset=orcamento_publico_brasil&filter=subfuncao.name%3A608>)
> and 609 (the request<http://openspending.org/api/2/search?q=&pagesize=100&format=json&dataset=orcamento_publico_brasil&filter=subfuncao.name%3A609>),
> it returns lots of ****, instead of the a expected string ("PROMOCAO DA
> PRODUCAO AGROPECUARIA" for the id 608, for instance).
>
> I tried to load the same CSV on a testing dataset and it is returning the
> name correctly for this two ids
> (here<http://openspending.org/api/2/search?q=&pagesize=100&format=json&dataset=um_teste&filter=subfuncao.name%3A608>and
> here<http://openspending.org/api/2/search?q=&pagesize=100&format=json&dataset=um_teste&filter=subfuncao.name%3A609>).
> Both datasets are not the actual I am using in a project. Actually, I
> created the orcamento_federal_brasil dataset to try to solve this after I
> discovering that the um_teste dataset didn't show up this problem.
>
> One difference between both datasets is that when I loaded this CSV for the
> one where the problem appears (orcamento_federal_brasil) is that it
> returned an error that a few entries were not created, [1] whilst in the
> other all entries are loaded without any error. The problematic dataset
> also have other CSV's loaded.
>
> Here is the CSV<https://dl.dropboxusercontent.com/s/qp2z43j6shc0juk/2013-limpo-com_filtro.csv>.
> I used the command uniq to check if there are repeated lines, but there are
> not. Those strings being transformed into asterisks also don't have any
> uncommon character, like accents (common on several other fields of this
> data).
>
> Any idea on what is happening, have experienced this or have some light on
> how to go further to check how are these strings converted into asterisks?
> (Maybe someone can point me the function of OS code that returns it through
> the API?)
>
> Thanks!
>
> Tom
>
> [1] 123701 rows were read, but only 123683 entries created. Check the
> unique key criteria, entries seem to overlap.
>
>
>
> _______________________________________________
> openspending-dev mailing list
> openspending-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/openspending-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/openspending-dev


-- 

Tryggvi Björgvinsson

Technical Lead, OpenSpending

The Open Knowledge Foundation <http://okfn.org>

/Empowering through Open Knowledge/

http://okfn.org/ | @okfn <http://twitter.com/OKFN> | OKF on Facebook
<https://facebook.com/OKFNetwork> | Blog <http://blog.okfn.org/> |
Newsletter <http://okfn.org/about/newsletter>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/openspending-dev/attachments/20131021/2b0310d5/attachment.html>


More information about the openspending-dev mailing list