{"html_url": "https://github.com/simonw/datasette/issues/1518#issuecomment-991819781", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1518", "id": 991819781, "node_id": "IC_kwDOBm6k_c47HfgF", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T01:53:10Z", "updated_at": "2021-12-12T01:53:10Z", "author_association": "OWNER", "body": "I have a hunch that the conclusion of this experiment may end up being that the `asyncinject` trick is kinda neat but the code will be easier to maintain (while still executing in parallel) if it's written using `asyncio.gather` directly instead.\r\n\r\nIt's possible `asyncinject` will end up being neat enough that I'll want to keep it though.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058072543, "label": "Complete refactor of TableView and table.html template"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1518#issuecomment-991822853", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1518", "id": 991822853, "node_id": "IC_kwDOBm6k_c47HgQF", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T02:24:00Z", "updated_at": "2021-12-12T02:24:00Z", "author_association": "OWNER", "body": "Rebuilding `TableView` from the ground up is proving not to be much fun. I'm going to explore starting the refactor of the existing code by separating out the bit that generates the SQL query from the rest of it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058072543, "label": "Complete refactor of TableView and table.html template"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1518#issuecomment-991823001", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1518", "id": 991823001, "node_id": "IC_kwDOBm6k_c47HgSZ", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T02:25:32Z", "updated_at": "2021-12-12T02:25:32Z", "author_association": "OWNER", "body": "The tests for `TableView` are currently mixed in with everything else in `tests/test_api.py` and `tests/html.py` - might be good to split those out into `test_table_html.py` and `test_table_api.py` since they're such a key part of how Datasette works.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058072543, "label": "Complete refactor of TableView and table.html template"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1518#issuecomment-991827468", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1518", "id": 991827468, "node_id": "IC_kwDOBm6k_c47HhYM", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T03:15:00Z", "updated_at": "2021-12-12T03:15:00Z", "author_association": "OWNER", "body": " I don't think this code is necessary any more: https://github.com/simonw/datasette/blob/492f9835aa7e90540dd0c6324282b109f73df71b/datasette/views/table.py#L396-L399\r\n\r\nThat dates back from when Datasette was built on top of Sanic and Sanic didn't preserve those query parameters the way I needed it to:\r\n\r\nhttps://github.com/simonw/datasette/blob/1f69269fe93e4cd42e56890126cc0dbcf719c6cb/datasette/views/table.py#L202-L206", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058072543, "label": "Complete refactor of TableView and table.html template"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1518#issuecomment-991828014", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1518", "id": 991828014, "node_id": "IC_kwDOBm6k_c47Hhgu", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T03:21:35Z", "updated_at": "2021-12-12T03:21:35Z", "author_association": "OWNER", "body": "No, removing that gave me the following test failure:\r\n```\r\ntests/test_table_api.py::test_table_filter_queries[/fixtures/simple_primary_key.json?content__exact=-expected_rows2] FAILED [100%]\r\n\r\n=============================================================================== FAILURES ================================================================================\r\n______________________________________ test_table_filter_queries[/fixtures/simple_primary_key.json?content__exact=-expected_rows2] ______________________________________\r\n\r\napp_client = , path = '/fixtures/simple_primary_key.json?content__exact=', expected_rows = [['3', '']]\r\n\r\n @pytest.mark.parametrize(\r\n \"path,expected_rows\",\r\n [\r\n (\"/fixtures/simple_primary_key.json?content=hello\", [[\"1\", \"hello\"]]),\r\n (\r\n \"/fixtures/simple_primary_key.json?content__contains=o\",\r\n [\r\n [\"1\", \"hello\"],\r\n [\"2\", \"world\"],\r\n [\"4\", \"RENDER_CELL_DEMO\"],\r\n ],\r\n ),\r\n (\"/fixtures/simple_primary_key.json?content__exact=\", [[\"3\", \"\"]]),\r\n (\r\n \"/fixtures/simple_primary_key.json?content__not=world\",\r\n [\r\n [\"1\", \"hello\"],\r\n [\"3\", \"\"],\r\n [\"4\", \"RENDER_CELL_DEMO\"],\r\n [\"5\", \"RENDER_CELL_ASYNC\"],\r\n ],\r\n ),\r\n ],\r\n )\r\n def test_table_filter_queries(app_client, path, expected_rows):\r\n response = app_client.get(path)\r\n> assert expected_rows == response.json[\"rows\"]\r\nE AssertionError: assert [['3', '']] == [['1', 'hello'],\\n ['2', 'world'],\\n ['3', ''],\\n ['4', 'RENDER_CELL_DEMO'],\\n ['5', 'RENDER_CELL_ASYNC']]\r\nE At index 0 diff: ['3', ''] != ['1', 'hello']\r\nE Right contains 4 more items, first extra item: ['2', 'world']\r\nE Full diff:\r\nE [\r\nE - ['1',\r\nE - 'hello'],\r\nE - ['2',\r\nE - 'world'],\r\nE ['3',\r\nE ''],\r\nE - ['4',\r\nE - 'RENDER_CELL_DEMO'],\r\nE - ['5',\r\nE - 'RENDER_CELL_ASYNC'],\r\nE ]\r\n\r\n/Users/simon/Dropbox/Development/datasette/tests/test_table_api.py:511: AssertionError\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058072543, "label": "Complete refactor of TableView and table.html template"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1551#issuecomment-991960416", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1551", "id": 991960416, "node_id": "IC_kwDOBm6k_c47IB1g", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T19:56:12Z", "updated_at": "2021-12-12T19:56:12Z", "author_association": "OWNER", "body": "Python documentation for `parse_qs`: https://docs.python.org/3/library/urllib.parse.html#urllib.parse.parse_qs\r\n\r\n> The optional argument *keep_blank_values* is a flag indicating whether blank values in percent-encoded queries should be treated as blank strings. A true value indicates that blanks should be retained as blank strings. The default false value indicates that blank values are to be ignored and treated as if they were not included.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1077893013, "label": "`keep_blank_values=True` when parsing `request.args`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1551#issuecomment-991960719", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1551", "id": 991960719, "node_id": "IC_kwDOBm6k_c47IB6P", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T19:58:17Z", "updated_at": "2021-12-12T19:58:17Z", "author_association": "OWNER", "body": "Here's an example of the difference that causes:\r\n```pycon\r\n>>> import urllib.parse\r\n>>> urllib.parse.parse_qs(\"foo=bar\")\r\n{'foo': ['bar']}\r\n>>> urllib.parse.parse_qs(\"foo=bar&baz=\")\r\n{'foo': ['bar']}\r\n>>> urllib.parse.parse_qs(\"foo=bar&baz=\", keep_blank_values=True)\r\n{'foo': ['bar'], 'baz': ['']}\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1077893013, "label": "`keep_blank_values=True` when parsing `request.args`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1551#issuecomment-991960179", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1551", "id": 991960179, "node_id": "IC_kwDOBm6k_c47IBxz", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T19:54:45Z", "updated_at": "2021-12-12T19:54:45Z", "author_association": "OWNER", "body": "This is technically a backwards-incompatible for any plugins that use `request.args` - but it's unlikely to break anything. At any rate this needs to happen before Datasette 1.0!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1077893013, "label": "`keep_blank_values=True` when parsing `request.args`"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1518#issuecomment-991978789", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1518", "id": 991978789, "node_id": "IC_kwDOBm6k_c47IGUl", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-12-12T22:04:19Z", "updated_at": "2021-12-12T22:04:19Z", "author_association": "OWNER", "body": "Idea: in JSON output include a `warnings` block listing any _ parameters that were not recognized.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1058072543, "label": "Complete refactor of TableView and table.html template"}, "performed_via_github_app": null}