{"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-407267762", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 407267762, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNzI2Nzc2Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-24T03:20:33Z", "updated_at": "2018-07-24T03:20:33Z", "author_association": "OWNER", "body": "Documentation: http://datasette.readthedocs.io/en/latest/json_api.html#special-json-arguments", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-407267707", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 407267707, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNzI2NzcwNw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-24T03:20:08Z", "updated_at": "2018-07-24T03:20:08Z", "author_association": "OWNER", "body": "Demo:\r\n* https://700d83d.datasette.io/fixtures-dcc1dbf/infinity.json - Infinity converted to Null\r\n* https://700d83d.datasette.io/fixtures-dcc1dbf/infinity.json?_json_infinity=on - invalid JSON containing `Infinity` and `-Infinity`", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-407262561", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 407262561, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNzI2MjU2MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-24T02:44:39Z", "updated_at": "2018-07-24T02:44:39Z", "author_association": "OWNER", "body": "According to https://www.mail-archive.com/sqlite-users@mailinglists.sqlite.org/msg110573.html you can insert Infinity/-Infinity in raw SQL (as used by our fixtures) using 1e999 and -1e999.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-407262436", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 407262436, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNzI2MjQzNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-24T02:43:50Z", "updated_at": "2018-07-24T02:43:50Z", "author_association": "OWNER", "body": "I'm going with `_json_infinity=1` as the querystring argument.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-407262311", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 407262311, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNzI2MjMxMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-24T02:43:03Z", "updated_at": "2018-07-24T02:43:03Z", "author_association": "OWNER", "body": "Actually SQLite doesn't handle NaN at all (it treats it as null) so I'm going to change this ticket to just deal with Infinity and -Infinity.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-405968983", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 405968983, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNTk2ODk4Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-18T15:18:57Z", "updated_at": "2018-07-18T15:18:57Z", "author_association": "OWNER", "body": "Maybe argument should be `?_json_nan=1` since that makes it more explicitly obvious what is going on here.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-404574598", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 404574598, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNDU3NDU5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-12T16:39:51Z", "updated_at": "2018-07-12T16:39:51Z", "author_association": "OWNER", "body": "Since my data is all flat lists of values I don't think I need to customize the JSON encoder itself (no need to deal with nested values). I'll fix the data on its way into the encoder instead. This will also help if I decide to move to uJSON for better performance #48", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-404569003", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 404569003, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNDU2OTAwMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-12T16:20:06Z", "updated_at": "2018-07-12T16:20:06Z", "author_association": "OWNER", "body": "And here's how django-rest-framework did it: https://github.com/encode/django-rest-framework/pull/4918/files", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-404567587", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 404567587, "node_id": "MDEyOklzc3VlQ29tbWVudDQwNDU2NzU4Nw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-12T16:15:29Z", "updated_at": "2018-07-12T16:17:54Z", "author_association": "OWNER", "body": "Here's how plotly handled this issue: https://github.com/plotly/plotly.py/pull/203 - see also https://github.com/plotly/plotly.py/blob/213602df6c89b45ce2b811ed2591171c961408e7/plotly/utils.py#L137", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-402243153", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 402243153, "node_id": "MDEyOklzc3VlQ29tbWVudDQwMjI0MzE1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-07-03T17:58:50Z", "updated_at": "2018-07-12T16:10:39Z", "author_association": "OWNER", "body": "I think I'm going to return `null` in the JSON for infinity/nan values by default, but if you send `_nan=1` I will instead return invalid JSON with `Infinity` or `NaN` in it (since you have opted in to getting those and hence should be able to handle them).", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-401478223", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 401478223, "node_id": "MDEyOklzc3VlQ29tbWVudDQwMTQ3ODIyMw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-29T21:26:12Z", "updated_at": "2018-06-29T21:26:19Z", "author_association": "OWNER", "body": "I'm not sure what the correct thing to do here is. I don't want to throw a `ValueError` when trying to render that data as JSON, but I also want to produce JSON that doesn't break when fetched by JavaScript.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/332#issuecomment-401477622", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/332", "id": 401477622, "node_id": "MDEyOklzc3VlQ29tbWVudDQwMTQ3NzYyMg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2018-06-29T21:23:17Z", "updated_at": "2018-06-29T21:23:55Z", "author_association": "OWNER", "body": "https://docs.python.org/3/library/json.html#json.dump\r\n\r\n> **json.dump**(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False, **kw)\u00b6\r\n> If `allow_nan` is false (default: True), then it will be a ValueError to serialize out of range float values (nan, inf, -inf) in strict compliance of the JSON specification. If allow_nan is true, their JavaScript equivalents (NaN, Infinity, -Infinity) will be used.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 337141108, "label": "Sanely handle Infinity/-Infinity values in JSON using ?_json_infinity=1"}, "performed_via_github_app": null}