Closed waldoj closed 10 years ago
So I tried changing:
if line[name] == "0000-00-00":
line[name] = ""
to:
if line[name] == "0000-00-00":
line[name] = 'null'
but that only resulted in JSON values of "null"
(with quotes), rather than null
. And, likewise, literal "null" values within the CSV. So I've got to figure out how to make sure that we wind up with actual blank (zero-length) fields in the CSV, but null
values in the JSON.
I'm going to try setting a value of None
(which is null
within Python) and see if that helps.
None
is making trouble with the remove_non_ascii()
function.
I think closing #23 will fix this.
OK, I have no idea why remove_non_ascii()
was ever an issue (I'm not sure that it was). The real problem here is that the value of None
is being quoted ("None"
), and thus not being changed into null
by json.dumps
. I haven't yet figured out where that quoting is happening.
It throws an error in response to blank date fields (e.g.,
"expiration-date": ""
), like such:My guess is that blank dates should be set to
null
, rather than an empty string.