{"id": 181600926, "node_id": "MDExOlB1bGxSZXF1ZXN0MTgxNjAwOTI2", "number": 204, "state": "closed", "locked": 0, "title": "Initial units support", "user": {"value": 45057, "label": "russss"}, "body": "Add support for specifying units for a column in metadata.json and rendering them on display using [pint](https://pint.readthedocs.io/en/latest/).\r\n\r\nExample table metadata:\r\n```json\r\n \"license_frequency\": {\r\n \"units\": {\r\n \"frequency\": \"Hz\",\r\n \"channel_width\": \"Hz\",\r\n \"height\": \"m\",\r\n \"antenna_height\": \"m\",\r\n \"azimuth\": \"degrees\"\r\n }\r\n }\r\n```\r\n\r\n[Example result](https://wtr-api.herokuapp.com/wtr-663ea99/license_frequency/1)\r\n\r\nThis works surprisingly well! I'd like to add support for using units when querying but this is PR is pretty usable as-is.\r\n\r\n(Pint doesn't seem to support decibels though - it thinks they're decibytes - which is an annoying omission.)\r\n\r\n(ref ticket #203)", "created_at": "2018-04-13T21:32:49Z", "updated_at": "2018-04-14T09:44:33Z", "closed_at": "2018-04-14T03:32:54Z", "merged_at": "2018-04-14T03:32:54Z", "merge_commit_sha": "ec6abc81e433c9bac1b9f085111785fc227e9e34", "assignee": null, "milestone": null, "draft": 0, "head": "67c20a98a0cbb59a10247a49320c2feb7d0b1b41", "base": "fb988ace7c7e2bee5ac142a0eab22431d0675a77", "author_association": "CONTRIBUTOR", "repo": {"value": 107914493, "label": "datasette"}, "url": "https://github.com/simonw/datasette/pull/204", "merged_by": null, "auto_merge": null} {"id": 181642114, "node_id": "MDExOlB1bGxSZXF1ZXN0MTgxNjQyMTE0", "number": 205, "state": "closed", "locked": 0, "title": "Support filtering with units and more", "user": {"value": 45057, "label": "russss"}, "body": "The first commit:\r\n* Adds units to exported JSON\r\n* Adds units key to metadata skeleton\r\n* Adds some docs for units\r\n\r\nThe second commit adds filtering by units by the first method I mentioned in #203:\r\n![image](https://user-images.githubusercontent.com/45057/38767463-7193be16-3fd9-11e8-8a5f-ac4159415c6d.png)\r\n\r\n[Try it here](https://wtr-api.herokuapp.com/wtr-663ea99/license_frequency?frequency__gt=50GHz&height__lt=50ft). I think it integrates pretty neatly.\r\n\r\nThe third commit adds support for registering custom units with Pint from metadata.json. Probably pretty niche, but I need decibels!", "created_at": "2018-04-14T10:47:51Z", "updated_at": "2018-04-14T15:24:04Z", "closed_at": "2018-04-14T15:24:04Z", "merged_at": null, "merge_commit_sha": "ed059c70e87a2930206652621e23a55167aa57c1", "assignee": null, "milestone": null, "draft": 0, "head": "eb3a37c34813ecbbfdae015305fec1f2a4ec27a5", "base": "6b15a53cd3cd40880a5e2d38827d5fac10e4bb5f", "author_association": "CONTRIBUTOR", "repo": {"value": 107914493, "label": "datasette"}, "url": "https://github.com/simonw/datasette/pull/205", "merged_by": null, "auto_merge": null} {"id": 181644805, "node_id": "MDExOlB1bGxSZXF1ZXN0MTgxNjQ0ODA1", "number": 206, "state": "closed", "locked": 0, "title": "Fix sqlite error when loading rows with no incoming FKs", "user": {"value": 45057, "label": "russss"}, "body": "This fixes `ERROR: conn=, sql\r\n= 'select ', params = {'id': '1'}` caused by an invalid query loading incoming FKs when none exist.\r\n\r\nThe error was ignored due to async but it still got printed to the console.", "created_at": "2018-04-14T12:08:17Z", "updated_at": "2018-04-14T14:32:42Z", "closed_at": "2018-04-14T14:24:25Z", "merged_at": "2018-04-14T14:24:25Z", "merge_commit_sha": "1cc5161089e559c8b16049b20f7a5b3a43290c21", "assignee": null, "milestone": null, "draft": 0, "head": "93b038e2469bee07d36ae8a943aab8b9d8610c1d", "base": "ec6abc81e433c9bac1b9f085111785fc227e9e34", "author_association": "CONTRIBUTOR", "repo": {"value": 107914493, "label": "datasette"}, "url": "https://github.com/simonw/datasette/pull/206", "merged_by": null, "auto_merge": null} {"id": 181647717, "node_id": "MDExOlB1bGxSZXF1ZXN0MTgxNjQ3NzE3", "number": 207, "state": "closed", "locked": 0, "title": "Link foreign keys which don't have labels", "user": {"value": 45057, "label": "russss"}, "body": "This renders unlabeled FKs as simple links. I can't see why this would cause any major problems.\r\n\r\n![image](https://user-images.githubusercontent.com/45057/38768722-ea15a000-3fef-11e8-8664-ffd7aa4894ea.png)\r\n\r\nAlso includes bonus fixes for two minor issues:\r\n\r\n* In foreign key link hrefs the primary key was escaped using HTML escaping rather than URL escaping. This broke some non-integer PKs.\r\n* Print tracebacks to console when handling 500 errors.", "created_at": "2018-04-14T13:27:14Z", "updated_at": "2018-04-14T15:00:00Z", "closed_at": "2018-04-14T15:00:00Z", "merged_at": "2018-04-14T15:00:00Z", "merge_commit_sha": "f2b940d6026677f6859d46a4f16fa402745d261d", "assignee": null, "milestone": null, "draft": 0, "head": "d9858672da8f74e5530deead140e2e633e1c2627", "base": "ec6abc81e433c9bac1b9f085111785fc227e9e34", "author_association": "CONTRIBUTOR", "repo": {"value": 107914493, "label": "datasette"}, "url": "https://github.com/simonw/datasette/pull/207", "merged_by": null, "auto_merge": null} {"id": 181654839, "node_id": "MDExOlB1bGxSZXF1ZXN0MTgxNjU0ODM5", "number": 208, "state": "closed", "locked": 0, "title": "Return HTTP 405 on InvalidUsage rather than 500", "user": {"value": 45057, "label": "russss"}, "body": "This also stops it filling up the logs. This happens for HEAD requests at the moment - which perhaps should be handled better, but that's a different issue.", "created_at": "2018-04-14T16:12:50Z", "updated_at": "2018-04-14T18:00:39Z", "closed_at": "2018-04-14T18:00:39Z", "merged_at": "2018-04-14T18:00:39Z", "merge_commit_sha": "efbb4e83374a2c795e436c72fa79f70da72309b8", "assignee": null, "milestone": null, "draft": 0, "head": "20e5fcf827046adf76968d0e58f47e0b7d9271c3", "base": "8d394586f55bc4b8ab70476968d08fb6ec8339e5", "author_association": "CONTRIBUTOR", "repo": {"value": 107914493, "label": "datasette"}, "url": "https://github.com/simonw/datasette/pull/208", "merged_by": null, "auto_merge": null}