mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Don't suggest array facet if column is only [], closes #610
This commit is contained in:
parent
ba5414f16b
commit
7152e76eda
2 changed files with 32 additions and 11 deletions
|
|
@ -215,6 +215,20 @@ async def test_array_facet_suggest(app_client):
|
|||
] == suggestions
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.skipif(not detect_json1(), reason="Requires the SQLite json1 module")
|
||||
async def test_array_facet_suggest_not_if_all_empty_arrays(app_client):
|
||||
facet = ArrayFacet(
|
||||
app_client.ds,
|
||||
MockRequest("http://localhost/"),
|
||||
database="fixtures",
|
||||
sql="select * from facetable where tags = '[]'",
|
||||
table="facetable",
|
||||
)
|
||||
suggestions = await facet.suggest()
|
||||
assert [] == suggestions
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.skipif(not detect_json1(), reason="Requires the SQLite json1 module")
|
||||
async def test_array_facet_results(app_client):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue