{"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072907610", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072907610, "node_id": "IC_kwDOBm6k_c4_80Va", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:55:29Z", "updated_at": "2022-03-19T00:55:29Z", "author_association": "OWNER", "body": "It looks to me like something is causing the faceting query here to return a string when it was expected to return a number:\r\n\r\nhttps://github.com/simonw/datasette/blob/32963018e7edfab1233de7c7076c428d0e5c7813/datasette/facets.py#L153-L170\r\n\r\nI can't think of any way that a `count(*) as n` would turn into a string though!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072907680", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072907680, "node_id": "IC_kwDOBm6k_c4_80Wg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:55:48Z", "updated_at": "2022-03-19T00:55:48Z", "author_association": "OWNER", "body": "... unless your data had a column called `n`?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072908029", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072908029, "node_id": "IC_kwDOBm6k_c4_80b9", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T00:57:54Z", "updated_at": "2022-03-19T00:57:54Z", "author_association": "OWNER", "body": "Yes! That's the problem. I was able to replicate it like so:\r\n```\r\necho '[{ \r\n \"n\": \"one\",\r\n \"abc\": 1\r\n}, {\r\n \"n\": \"one\",\r\n \"abc\": 2\r\n}, {\r\n \"n\": \"two\",\r\n \"abc\": 3\r\n}]' | sqlite-utils insert column-called-n.db t -\r\n```\r\n\"image\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072915936", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072915936, "node_id": "IC_kwDOBm6k_c4_82Xg", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-03-19T01:50:27Z", "updated_at": "2022-03-19T01:50:27Z", "author_association": "OWNER", "body": "Demo: https://latest.datasette.io/fixtures/facetable - which now has a column called `n`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1228#issuecomment-1072954795", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1228", "id": 1072954795, "node_id": "IC_kwDOBm6k_c4_8_2r", "user": {"value": 7107523, "label": "Kabouik"}, "created_at": "2022-03-19T06:44:40Z", "updated_at": "2022-03-19T06:44:40Z", "author_association": "NONE", "body": "> ... unless your data had a column called `n`?\r\n\r\nExactly, that's highly likely even though I can't double check from this computer just now. Thanks!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 810397025, "label": "500 error caused by faceting if a column called `n` exists"}, "performed_via_github_app": null}