Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Columns beginning with an underscore do not facet correctly #1506

Closed
simonw opened this issue Nov 14, 2021 · 1 comment
Closed

Columns beginning with an underscore do not facet correctly #1506

simonw opened this issue Nov 14, 2021 · 1 comment
Labels

Comments

@simonw
Copy link
Owner

simonw commented Nov 14, 2021

Datasette treats columns that start with an underscore as querystring parameters it should ignore!

bchydro__item_versions__99_918_rows

Discovered in simonw/git-history#14 (comment)

@simonw simonw added the bug label Nov 14, 2021
@simonw
Copy link
Owner Author

simonw commented Nov 14, 2021

I think the answer is to spot this case and link to ?_item_exact=x instead of ?_item=x - it looks like that's already recommended in the documentation here: https://docs.datasette.io/en/stable/json_api.html#column-filter-arguments

?column__exact=value or ?_column=value
Returns rows where the specified column exactly matches the value.

So maybe the facet selection rendering logic needs to spot this and link correctly to it?

@simonw simonw changed the title Weird inconsistent behaviour if columns begin with an underscore Columns beginning with an underscore do not facet correctly Nov 14, 2021
@simonw simonw closed this as completed in c306b69 Nov 14, 2021
simonw added a commit that referenced this issue Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant