&stream=True fails for JSON results
Closed this issue · 2 comments
Adding &stream=True
works for CSV and XML results, but not for JSON.
Confirmation links
The following queries return only 665 activities as of 2018-08-30, so size is not likely an issue.
[200 Success] http://datastore.iatistandard.org/api/1/access/activity.xml?recipient-country=GN&end-date__gt=2018-01-01&stream=True
[200 Success] http://datastore.iatistandard.org/api/1/access/activity.xml?recipient-country=GN&end-date__gt=2018-01-01&stream=True
[Redirects to following, then 500 Internal Server Error] http://datastore.iatistandard.org/api/1/access/activity.json?recipient-country=GN&end-date__gt=2018-01-01&stream=True
[500 Internal Server Error] http://datastore.iatistandard.org/api/1/access/activity.json?recipient-country=GN&end-date__gt=2018-01-01&stream=True
To confirm that the issue isn't the result size, this query returns all of the existing JSON results with &limit=700
:
The JSON serialiser uses the following wrapper around a query, to make it “quack like a pagination object”:
IATI-Datastore/iati_datastore/iatilib/frontend/api1.py
Lines 181 to 191 in 6fe7aba
However, the query isn’t actually executed, so serialisation fails. I’ve sent a fix (#317).