{"url":"https://api.github.com/repos/simonw/datasette/issues/2208","repository_url":"https://api.github.com/repos/simonw/datasette","labels_url":"https://api.github.com/repos/simonw/datasette/issues/2208/labels{/name}","comments_url":"https://api.github.com/repos/simonw/datasette/issues/2208/comments","events_url":"https://api.github.com/repos/simonw/datasette/issues/2208/events","html_url":"https://github.com/simonw/datasette/issues/2208","id":1994857251,"node_id":"I_kwDOBm6k_c525xsj","number":2208,"title":"No suggested facets when a column named 'value' is included","user":{"login":"rgieseke","id":198537,"node_id":"MDQ6VXNlcjE5ODUzNw==","avatar_url":"https://avatars.githubusercontent.com/u/198537?v=4","gravatar_id":"","url":"https://api.github.com/users/rgieseke","html_url":"https://github.com/rgieseke","followers_url":"https://api.github.com/users/rgieseke/followers","following_url":"https://api.github.com/users/rgieseke/following{/other_user}","gists_url":"https://api.github.com/users/rgieseke/gists{/gist_id}","starred_url":"https://api.github.com/users/rgieseke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgieseke/subscriptions","organizations_url":"https://api.github.com/users/rgieseke/orgs","repos_url":"https://api.github.com/users/rgieseke/repos","events_url":"https://api.github.com/users/rgieseke/events{/privacy}","received_events_url":"https://api.github.com/users/rgieseke/received_events","type":"User","user_view_type":"public","site_admin":false},"labels":[],"state":"open","locked":false,"assignees":[],"milestone":null,"comments":1,"created_at":"2023-11-15T14:11:17Z","updated_at":"2023-11-15T14:18:59Z","closed_at":null,"assignee":null,"author_association":"CONTRIBUTOR","active_lock_reason":null,"sub_issues_summary":{"total":0,"completed":0,"percent_completed":0},"issue_dependencies_summary":{"blocked_by":0,"total_blocked_by":0,"blocking":0,"total_blocking":0},"body":"When a column named 'value' is included there are no suggested facets is shown as the query uses an alias of 'value'.\r\n\r\nhttps://github.com/simonw/datasette/blob/452a587e236ef642cbc6ae345b58767ea8420cb5/datasette/facets.py#L168-L174\r\n\r\nCurrently the following is shown (from https://latest.datasette.io/fixtures/facetable)\r\n\r\n![image](https://github.com/simonw/datasette/assets/198537/a919509a-ea88-461b-b25b-8b776720c7c5)\r\n\r\nWhen I add a column named 'value' only the JSON facets are processed.\r\n\r\n![image](https://github.com/simonw/datasette/assets/198537/092bd0b3-4c20-434e-88f8-47e2b8994a1d)\r\n\r\nI think that not using aliases could be a solution (except if someone wants to use a column named `count(*)` though this seems to be unlikely). I'll open a PR with that.\r\n\r\nThere is also a TODO with a similar question in the same file. I have not looked into that yet.\r\n\r\nhttps://github.com/simonw/datasette/blob/452a587e236ef642cbc6ae345b58767ea8420cb5/datasette/facets.py#L512","closed_by":null,"reactions":{"url":"https://api.github.com/repos/simonw/datasette/issues/2208/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/simonw/datasette/issues/2208/timeline","performed_via_github_app":null,"state_reason":null,"pinned_comment":null}