mirror of
https://github.com/apache/superset.git
synced 2026-07-12 09:45:43 +00:00
feat(semantic layers): dashboard filters (#40475)
This commit is contained in:
@@ -375,6 +375,28 @@ def test_convert_query_object_filter_in(mock_datasource: MagicMock) -> None:
|
||||
}
|
||||
|
||||
|
||||
def test_convert_query_object_filter_ilike_rejected(
|
||||
mock_datasource: MagicMock,
|
||||
) -> None:
|
||||
"""
|
||||
Case-insensitive operators are rejected explicitly rather than silently
|
||||
collapsed into LIKE — that collapse would let the backend's collation
|
||||
decide case sensitivity, silently diverging from the filter the dashboard
|
||||
author selected.
|
||||
"""
|
||||
all_dimensions = {
|
||||
dim.name: dim for dim in mock_datasource.implementation.dimensions
|
||||
}
|
||||
for op in (FilterOperator.ILIKE.value, FilterOperator.NOT_ILIKE.value):
|
||||
filter_: ValidatedQueryObjectFilterClause = {
|
||||
"op": op,
|
||||
"col": "category",
|
||||
"val": "%book%",
|
||||
}
|
||||
with pytest.raises(ValueError, match="case-insensitive"):
|
||||
_convert_query_object_filter(filter_, all_dimensions)
|
||||
|
||||
|
||||
def test_convert_query_object_filter_is_null(mock_datasource: MagicMock) -> None:
|
||||
"""
|
||||
Test conversion of IS_NULL filter.
|
||||
|
||||
Reference in New Issue
Block a user