{"html_url": "https://github.com/simonw/datasette/issues/1300#issuecomment-1177893425", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1300", "id": 1177893425, "node_id": "IC_kwDOBm6k_c5GNTox", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-07-07T16:28:13Z", "updated_at": "2022-07-07T16:28:13Z", "author_association": "OWNER", "body": "Adding `row` to this plugin hook is a smart idea.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 860625833, "label": "Make row available to `render_cell` plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1300#issuecomment-1177901762", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1300", "id": 1177901762, "node_id": "IC_kwDOBm6k_c5GNVrC", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-07-07T16:34:05Z", "updated_at": "2022-07-07T16:34:05Z", "author_association": "OWNER", "body": "Updated documentation: https://docs.datasette.io/en/latest/plugin_hooks.html#render-cell-row-value-column-table-database-datasette", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 860625833, "label": "Make row available to `render_cell` plugin hook"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1768#issuecomment-1177966193", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1768", "id": 1177966193, "node_id": "IC_kwDOBm6k_c5GNlZx", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-07-07T17:25:22Z", "updated_at": "2022-07-07T17:25:22Z", "author_association": "OWNER", "body": "I tried this on Datasette Cloud and swapping `datasetteproject/datasette` to `python:3.10-slim-bullseye` as the base image dropped the overall image size from ~232MB to ~166MB - but note that I don't have SpatiaLite in that second image.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1296222572, "label": "Upgrade to 3.10.6-slim-bullseye Docker base image"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/sqlite-utils/issues/444#issuecomment-1155815956", "issue_url": "https://api.github.com/repos/simonw/sqlite-utils/issues/444", "id": 1155815956, "node_id": "IC_kwDOCGYnMM5E5FoU", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-06-14T23:49:56Z", "updated_at": "2022-07-07T16:39:18Z", "author_association": "OWNER", "body": "Yeah my initial implementation there makes no sense:\r\n```python\r\n csv_reader_args = {\"dialect\": dialect}\r\n if delimiter:\r\n csv_reader_args[\"delimiter\"] = delimiter\r\n if quotechar:\r\n csv_reader_args[\"quotechar\"] = quotechar\r\n reader = _extra_key_strategy(\r\n csv_std.reader(decoded, **csv_reader_args), ignore_extras, extras_key\r\n )\r\n first_row = next(reader)\r\n if no_headers:\r\n headers = [\"untitled_{}\".format(i + 1) for i in range(len(first_row))]\r\n reader = itertools.chain([first_row], reader)\r\n else:\r\n headers = first_row\r\n docs = (dict(zip(headers, row)) for row in reader)\r\n```\r\nBecause my `_extra_key_strategy()` helper function is designed to work against `csv.DictReader` - not against `csv.reader()` which returns a sequence of lists, not a sequence of dictionaries.\r\n\r\nIn fact, what's happening here is that `dict(zip(headers, row))` is ignoring anything in the row that doesn't correspond to a header:\r\n\r\n```pycon\r\n>>> list(zip([\"a\", \"b\"], [1, 2, 3]))\r\n[('a', 1), ('b', 2)]\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1271426387, "label": "CSV `extras_key=` and `ignore_extras=` equivalents for CLI tool"}, "performed_via_github_app": null}