wireservice / csvkit

A suite of utilities for converting to and working with CSV, the king of tabular file formats.
https://csvkit.readthedocs.io
MIT License
6.03k stars 603 forks source link

sql2csv - Unicode indicators #1118

Closed IdrissaD closed 3 years ago

IdrissaD commented 3 years ago

Hello! Exporting postgresql table into csv with csvkit added a unicode marker u before every json element, as you can see here: [{u'nom': u'CC Gorges Causses C\xe9vennes', u'contact': u'https://www.gorgescaussescevennes.fr/'}]

Is there a way to avoid this, as it causes problems afterwards for validating the json against a schema?

jpmckinney commented 3 years ago

What version of Python are you using? I think this can only occur in Python 2.7, which is end-of-life and is not supported.

IdrissaD commented 3 years ago

Hm yeah I think that was the reason, thanks! I got away with it by casting my field to text instead of json.