html_url,issue_url,id,node_id,user,user_label,created_at,updated_at,author_association,body,reactions,issue,issue_label,performed_via_github_app https://github.com/simonw/datasette/issues/1345#issuecomment-851127314,https://api.github.com/repos/simonw/datasette/issues/1345,851127314,MDEyOklzc3VlQ29tbWVudDg1MTEyNzMxNA==,9599,simonw,2021-05-31T02:40:26Z,2021-05-31T02:40:44Z,OWNER,"Demo: https://latest.datasette.io/fixtures/facetable?_facet=state&_nocol=state - the state column is not selected but facet by state still works: ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",904071938,?_nocol= does not interact well with default facets, https://github.com/simonw/datasette/issues/1345#issuecomment-851120306,https://api.github.com/repos/simonw/datasette/issues/1345,851120306,MDEyOklzc3VlQ29tbWVudDg1MTEyMDMwNg==,9599,simonw,2021-05-31T02:14:36Z,2021-05-31T02:14:36Z,OWNER,"Yes! This was easier than I thought. I'm going with that solution - where facets are calculated against all columns, ignoring `?_col=` and `?_nocol=` entirely.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",904071938,?_nocol= does not interact well with default facets, https://github.com/simonw/datasette/issues/1345#issuecomment-851117233,https://api.github.com/repos/simonw/datasette/issues/1345,851117233,MDEyOklzc3VlQ29tbWVudDg1MTExNzIzMw==,9599,simonw,2021-05-31T02:04:35Z,2021-05-31T02:04:35Z,OWNER,"That long-term solution may not be too difficult. The facets are calculated against `sql_no_limit` which is constructed here: https://github.com/simonw/datasette/blob/7b106e106000713bbee31b34d694b3dadbd4818c/datasette/views/table.py#L659-L665 And used here: https://github.com/simonw/datasette/blob/7b106e106000713bbee31b34d694b3dadbd4818c/datasette/views/table.py#L706-L718 Crucially, `sql_no_limit` is ONLY used for faceting - nothing else uses it anywhere. So constructing it before constructing `sql` and taking `?_col=` and `?_nocol=` into account may not be a complex change.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",904071938,?_nocol= does not interact well with default facets, https://github.com/simonw/datasette/issues/1345#issuecomment-851116105,https://api.github.com/repos/simonw/datasette/issues/1345,851116105,MDEyOklzc3VlQ29tbWVudDg1MTExNjEwNQ==,9599,simonw,2021-05-31T02:00:44Z,2021-05-31T02:00:44Z,OWNER,"Maybe there's a short-term and longer-term solution for this - where the long-term solution is to use different columns in the faceting selects, while the short-term solution is to disable ""Hide this column"" for certain things.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",904071938,?_nocol= does not interact well with default facets, https://github.com/simonw/datasette/issues/1345#issuecomment-851115805,https://api.github.com/repos/simonw/datasette/issues/1345,851115805,MDEyOklzc3VlQ29tbWVudDg1MTExNTgwNQ==,9599,simonw,2021-05-31T01:59:39Z,2021-05-31T01:59:39Z,OWNER,"Maybe there's a concept here of the columns that are required by a selected facet? Those can then be included as `data-` attributes on the page, which will then impact which ""Hide this column"" options are available. I can also use them to provide a better error message than ""no such column: state"" - I can verify that `?_nocol` and `?_col` have not been used to disable the required columns. There is one other option here: I could still include the columns that are known to be needed for faceting in the faceting SQL queries, but leave them out of the query that is used to return the results! That's actually a pretty tempting (albeit more complex) option.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",904071938,?_nocol= does not interact well with default facets, https://github.com/simonw/datasette/issues/1345#issuecomment-851114806,https://api.github.com/repos/simonw/datasette/issues/1345,851114806,MDEyOklzc3VlQ29tbWVudDg1MTExNDgwNg==,9599,simonw,2021-05-31T01:55:56Z,2021-05-31T01:55:56Z,OWNER,"Two options here: - Don't provide users with options that will lead to this situation - so no ""Hide this column"" option on pages that are already faceted by that column - Ignore facet selections for columns which are no longer visible I think I like the first option more. I could partially implement that in the `table.js` JavaScript by looking at the `?_facet=` parameters... but that won't cover the case where the facet is happening because of default facets configured in `metadata.yml`. Instead the JavaScript should look for evidence in the DOM that specific facets are enabled. This could also help me cover other types of faceting, such as `?_facet_array=` or even custom facets provided by plugins.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",904071938,?_nocol= does not interact well with default facets, https://github.com/simonw/datasette/issues/1345#issuecomment-851113886,https://api.github.com/repos/simonw/datasette/issues/1345,851113886,MDEyOklzc3VlQ29tbWVudDg1MTExMzg4Ng==,9599,simonw,2021-05-31T01:52:27Z,2021-05-31T01:52:27Z,OWNER,"Related issue: visit https://latest.datasette.io/fixtures/facetable?_facet=state and click ""Hide this column"" on the ""state"" cog menu and you get https://latest.datasette.io/fixtures/facetable?_facet=state&_nocol=state which shows an error: > ### Invalid SQL > no such column: state ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",904071938,?_nocol= does not interact well with default facets,