{"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1652681136", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1652681136, "node_id": "IC_kwDOBm6k_c5igemw", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-07-26T23:30:44Z", "updated_at": "2023-07-26T23:30:44Z", "author_association": "OWNER", "body": "The `_shape=` stuff should use `json_renderer` instead - that's how the table view did it:\r\nhttps://github.com/simonw/datasette/commit/d97e82df3c8a3f2e97038d7080167be9bb74a68d#diff-5c9ef29c33ed0fde413565b23fa258d60fc3a2bb205b016db9e915c9bd5ecfb3\r\n\r\nhttps://github.com/simonw/datasette/blob/c3e3ecf590ca5fa61b00aba4c78599e33d370b60/datasette/views/table.py#L822-L850\r\n\r\nInstead of:\r\n\r\nhttps://github.com/simonw/datasette/blob/c3e3ecf590ca5fa61b00aba4c78599e33d370b60/datasette/views/database.py#L239-L288", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668568445", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668568445, "node_id": "IC_kwDOBm6k_c5jdFV9", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-07T20:57:46Z", "updated_at": "2023-08-07T20:57:46Z", "author_association": "OWNER", "body": "17 failing tests now.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668578107", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668578107, "node_id": "IC_kwDOBm6k_c5jdHs7", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-07T21:06:50Z", "updated_at": "2023-08-07T21:06:50Z", "author_association": "OWNER", "body": "15:\r\n```\r\n=========================================================================================== short test summary info ============================================================================================\r\nFAILED tests/test_cli.py::test_sql_errors_logged_to_stderr - assert 0 == 1\r\nFAILED tests/test_html.py::test_show_hide_sql_query - AssertionError: assert False\r\nFAILED tests/test_canned_queries.py::test_magic_parameters_cannot_be_used_in_arbitrary_queries - assert 400 == 200\r\nFAILED tests/test_html.py::test_templates_considered[/fixtures-database-fixtures.html, *database.html] - assert '' in '\\n\\n\\n fixtures\\n CSV' in '\\n\\n\\n fixtures: select 1\\n ' in '\\n\\n\\n fixtures: select * from...\r\nFAILED tests/test_plugins.py::test_hook_extra_css_urls[/fixtures-expected_decoded_object1] - AssertionError: assert equals failed\r\nFAILED tests/test_plugins.py::test_view_names[/fixtures-database] - AssertionError: assert equals failed\r\nFAILED tests/test_plugins.py::test_view_names[/fixtures?sql=select+1-database] - AssertionError: assert equals failed\r\nFAILED tests/test_plugins.py::test_hook_extra_body_script[/fixtures-expected_extra_body_script1] - AssertionError: assert equals failed\r\nFAILED tests/test_html.py::test_base_url_config[False-/fixtures?sql=select+1] - AssertionError: {\r\nFAILED tests/test_table_api.py::test_max_returned_rows - KeyError: 'query'\r\nFAILED tests/test_html.py::test_alternate_url_json[/fixtures-http://localhost/fixtures.json] - KeyError: 'link'\r\n============================================================================ 15 failed, 1297 passed, 2 skipped, 1 xfailed in 58.15s ============================================================================\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668687891", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668687891, "node_id": "IC_kwDOBm6k_c5jdigT", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-07T23:11:04Z", "updated_at": "2023-08-07T23:14:34Z", "author_association": "OWNER", "body": "One of the failing tests is because this URL on my local environment returns this:\r\n\r\nhttp://127.0.0.1:8001/_memory.json?sql=select+blah\r\n```json\r\n{\"rows\": [], \"columns\": [], \"truncated\": false}\r\n```\r\nWith a 200 status code. It should be an error.\r\n\r\nhttps://latest.datasette.io/_memory.json?sql=select+blah returns a 400 status code with the following JSON:\r\n\r\n```json\r\n{\r\n \"ok\": false,\r\n \"database\": \"_memory\",\r\n \"query_name\": null,\r\n \"rows\": [],\r\n \"truncated\": false,\r\n \"columns\": [],\r\n \"query\": {\r\n \"sql\": \"select blah\",\r\n \"params\": {}\r\n },\r\n \"error\": \"no such column: blah\",\r\n \"private\": false,\r\n \"allow_execute_sql\": true,\r\n \"query_ms\": 2.68310698447749,\r\n \"source\": \"tests/fixtures.py\",\r\n \"source_url\": \"https://github.com/simonw/datasette/blob/main/tests/fixtures.py\",\r\n \"license\": \"Apache License 2.0\",\r\n \"license_url\": \"https://github.com/simonw/datasette/blob/main/LICENSE\"\r\n}\r\n```\r\nSo I need a design for what this should look like for the error case.\r\n\r\nI should consider what errors look like for alternative formats too.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668688947", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668688947, "node_id": "IC_kwDOBm6k_c5jdiwz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-07T23:12:37Z", "updated_at": "2023-08-07T23:12:37Z", "author_association": "OWNER", "body": "https://latest.datasette.io/_memory.csv?sql=select+blah is a blank page right now:\r\n\r\n```bash\r\ncurl -I 'https://latest.datasette.io/_memory.csv?sql=select+blah'\r\n```\r\n```\r\nHTTP/2 200 \r\naccess-control-allow-origin: *\r\naccess-control-allow-headers: Authorization, Content-Type\r\naccess-control-expose-headers: Link\r\naccess-control-allow-methods: GET, POST, HEAD, OPTIONS\r\naccess-control-max-age: 3600\r\ncontent-type: text/plain; charset=utf-8\r\nx-databases: _memory, _internal, fixtures, fixtures2, extra_database, ephemeral\r\ndate: Mon, 07 Aug 2023 23:12:15 GMT\r\nserver: Google Frontend\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668691898", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668691898, "node_id": "IC_kwDOBm6k_c5jdje6", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-07T23:15:14Z", "updated_at": "2023-08-07T23:16:28Z", "author_association": "OWNER", "body": "New error design:\r\n```json\r\n{\"ok\": false, \"error\": \"Error message here\", \"rows\": [], \"columns\": [], \"truncated\": false}\r\n```\r\nI guess that means I need to add `\"ok\": true` to the default format as well - which makes sense because table JSON has that already:\r\n\r\nhttps://latest.datasette.io/fixtures/facetable.json\r\n\r\n```json\r\n{\r\n \"ok\": true,\r\n \"next\": null,\r\n \"rows\": [...]\r\n}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668715803", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668715803, "node_id": "IC_kwDOBm6k_c5jdpUb", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-07T23:50:26Z", "updated_at": "2023-08-08T01:41:53Z", "author_association": "OWNER", "body": "This bit needs some more work: https://github.com/simonw/datasette/blob/a791115e31e64e9bbd1d36f4d46887b3e42e752a/datasette/views/database.py#L514-L518\r\n\r\nThe original logic for that is from here, I need to figure out how to replicate it:\r\n\r\nhttps://github.com/simonw/datasette/blob/5139c0886a7f6bb94d317ba0665aa6e728716028/datasette/views/base.py#L368\r\n\r\nhttps://github.com/simonw/datasette/blob/5139c0886a7f6bb94d317ba0665aa6e728716028/datasette/views/base.py#L342-L344\r\n\r\nUPDATE: Fixed the `_size=max` bit, but I've not replicated the behaviour where it adds `?_labels=on` if there are expandable columns yet.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668720671", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668720671, "node_id": "IC_kwDOBm6k_c5jdqgf", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-07T23:58:21Z", "updated_at": "2023-08-07T23:58:21Z", "author_association": "OWNER", "body": "11 tests left:\r\n```\r\nFAILED tests/test_html.py::test_alternate_url_json[/fixtures-http://localhost/fixtures.json] - KeyError: 'link'\r\nFAILED tests/test_html.py::test_alternate_url_json[/fixtures?sql=select+*+from+facetable-http://localhost/fixtures.json?sql=select+*+from+facetable] - assert '<link rel=\"alternate\" type=\"application/json+datasette\" href=\"http://localhost/fixtures.json?sql=select+*+from+facetable\">' in '<!DOCTYPE html>\\n<html>\\n<head>\\n <title>fixtures: select * from...\r\nFAILED tests/test_html.py::test_query_page_truncates - assert equals failed\r\nFAILED tests/test_html.py::test_templates_considered[/fixtures-database-fixtures.html, *database.html] - assert '<!-- Templates considered: database-fixtures.html, *database.html -->' in '<!DOCTYPE html>\\n<html>\\n<head>\\n <title>fixtures\\n CSV' in '\\n\\n\\n fixtures: select 1\\n CSV' in '\\n\\n\\n fixtures: select 1\\n UPDATE: Fixed the `_size=max` bit, but I've not replicated the behaviour where it adds `?_labels=on` if there are expandable columns yet.\r\n\r\nIt looks like that behaviour is only relevant to table views, and it's already implemented - https://latest.datasette.io/fixtures/roadside_attraction_characteristics links to https://latest.datasette.io/fixtures/roadside_attraction_characteristics.csv?_labels=on&_size=max", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/pull/2118#issuecomment-1668789134", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/2118", "id": 1668789134, "node_id": "IC_kwDOBm6k_c5jd7OO", "user": {"value": 9599, "label": "simonw"}, "created_at": "2023-08-08T01:46:12Z", "updated_at": "2023-08-08T01:46:12Z", "author_association": "OWNER", "body": "I'm going to squash merge this even though it's a bit big, because I want a clean passing commit in the `main` branch.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1823352380, "label": "New JSON design for query views"}, "performed_via_github_app": null}