Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Latin characters not accepted in JSON DataStore fields #2969
CKAN version if known (or site URL)
2.3 (private deployment)
Please describe the expected behaviour
The following dataset upsert should return
Please describe the actual behaviour
The following traces were taken from the log:
What steps can be taken to reproduce the issue?
Data upsert using a latin character:
@frbattid Can you check if the following patch fixes the issue for you?
diff --git a/ckanext/datastore/db.py b/ckanext/datastore/db.py index 1121c9e..895971c 100644 --- a/ckanext/datastore/db.py +++ b/ckanext/datastore/db.py @@ -255,7 +255,7 @@ def json_get_values(obj, current_list=None): elif isinstance(obj, dict): json_get_values(obj.items(), current_list) elif obj: - current_list.append(str(obj)) + current_list.append(unicode(obj)) return current_list
Also can you share the table structure of that DataStore resource? Something like:
It's really bizarre because I can see the problem on the stack trace you pasted, but I didn't manage to reproduce the issue, ie I couldn't make that code execute with the same request.
@amercader this is what we got:
@frbattid That what I imagined, as the fields have a "json" type. Is there a reason why fields like "Temperature" are stored as JSON? Are they actually JSON values?
Of course the original issue remains, so can you confirm if the patch I pasted on my last message fixes it?