aminghadersohi commented on PR #45021:
URL: https://github.com/apache/superset/pull/45021#issuecomment-6023941823

   ## Acceptance test at `e4454d3e`: all items pass
   
   **Setup:** `docker-compose-light` environment on this branch with examples 
loaded. I ran the MCP server in the app container (`superset mcp run --port 
5008`, `MCP_DEV_USERNAME=admin`) and called the tools over the streamable HTTP 
transport (`fastmcp.Client("http://localhost:5008/mcp";)`). Target: dashboard 6 
"USA Births Names" (no native filters at the start), dataset 17 `birth_names`. 
I read the stored shape straight from `dashboards.json_metadata`. Unit tests: 
`test_manage_native_filters.py`, `test_apply_dashboard_filters.py`, 
`test_dashboard_schemas.py`, `test_tool_inventory.py`: **535 passed**.
   
   | # | Acceptance item | Result | Evidence |
   |---|---|---|---|
   | 1 | Divider spec (title + description, no dataset/column) in the `add` 
union | ✅ pass | `manage_native_filters(add=[divider "Demographics", 
filter_select Gender, divider "Geography", filter_select State])` → 
`added_filter_ids: 
["NATIVE_FILTER_DIVIDER-bd374538","NATIVE_FILTER-b2d3d7dd","NATIVE_FILTER_DIVIDER-7f3866d7","NATIVE_FILTER-364e214c"]`,
 `error: null` |
   | 2 | Stored shape matches what the UI writes | ✅ pass | DB: `{"id": 
"NATIVE_FILTER_DIVIDER-bd374538", "type": "DIVIDER", "title": "Demographics", 
"description": "Who was born", "scope": {"rootPath": ["ROOT_ID"], "excluded": 
[]}}`. No `filterType`/`targets`/`controlValues`. The dashboard renders it as a 
native divider (screenshot 2). |
   | 3 | `reorder` handles dividers alongside filters | ✅ pass | 
`reorder=["…DIVIDER-7f3866d7","…-364e214c","…DIVIDER-bd374538","…-b2d3d7dd"]` → 
response and DB in exactly that order; the filter bar shows "Geography / State 
/ Demographics / Gender" (screenshot 3) |
   | 4 | Update a divider's title/description | ✅ pass | `update=[{id: 
DIVIDER-7f3866d7, name: "Where", description: "State-level filters"}]` → 
`updated_filter_ids: [DIVIDER-7f3866d7]`. DB has `"title": "Where"` with no 
stray `name`/`controlValues` key, and the bar shows "Where" (screenshot 3). |
   | 5 | Divider update rejects `scope_chart_ids` | ✅ pass | `update=[{id: 
DIVIDER-7f3866d7, scope_chart_ids: [71,72]}]` → `error: "Divider 
'NATIVE_FILTER_DIVIDER-7f3866d7' does not support scope_chart_ids; dividers are 
always in scope."`. DB scope stays `excluded: []`. |
   | 6 | Divider update rejects type-specific fields | ✅ pass | `update=[{id: 
DIVIDER-7f3866d7, column: "state", multi_select: false}]` → `error: "Filter 
'NATIVE_FILTER_DIVIDER-7f3866d7' has type 'divider'; fields ['column', 
'multi_select'] only apply to filter_range, filter_select filters."` |
   | 7 | Remove a divider | ✅ pass | 
`remove=["NATIVE_FILTER_DIVIDER-bd374538"]` → `removed_filter_ids: 
[DIVIDER-bd374538]`. The DB holds only the 3 remaining entries and the bar 
drops the divider (screenshot 4). |
   | 8 | Dividers excluded from `apply_dashboard_filters` errors | ✅ pass | 
Unknown id `NATIVE_FILTER-doesnotexist` → `"No filter named … Filters on this 
dashboard: State (id=NATIVE_FILTER-364e214c, type=filter_select), Gender 
(id=NATIVE_FILTER-b2d3d7dd, type=filter_select)."` A divider's title 
(`"Where"`) gives the same list, with no divider in it. Applying to real filter 
`Gender=["boy"]` still works and returns permalink `l3jxQvjQvGZ`. |
   | 9 | Read path (`get_dashboard_info`) reports dividers | ✅ pass | 
`native_filters` → `{"id": "NATIVE_FILTER_DIVIDER-bd374538", "name": 
"Demographics", "filter_type": "divider", "targets": []}`, not `null`/`null` |
   | 10 | Create validation | ✅ pass | divider with `name: ""` → `String is 
shorter than the allowed minimum` |
   
   **Non-blocking observations (no change needed for this PR):**
   - `apply_dashboard_filters` called *by a divider's id* returns `"Filter 
'NATIVE_FILTER_DIVIDER-7f3866d7' has type 'None', which this tool cannot apply 
values to…"`. The call is correctly refused, but the message says `'None'` 
where `'divider'` would read better.
   - A divider `add` with `dataset_id`/`column` is accepted and those keys are 
ignored. The stored entry is a clean divider. No spec in this union sets 
`extra="forbid"`, so this matches the other filter types.
   
   ### Screenshots (dashboard filter bar)
   | 1. Before (no filters) | 2. After `add` (2 dividers + 2 filters) | 3. 
After `reorder` + divider rename | 4. After removing "Demographics" divider |
   |---|---|---|---|
   | 
![before](https://gist.githubusercontent.com/aminghadersohi/96dc57dd1b1bd0539d461f6d2d980f31/raw/10dce34afab64248f5e4619e0a0d655bdf1ccf04/before_bar.png)
 | ![after 
add](https://gist.githubusercontent.com/aminghadersohi/96dc57dd1b1bd0539d461f6d2d980f31/raw/a381dc2d58d1271ad4cc9dd032711b0fe9d4af41/after_create_bar.png)
 | ![after reorder and 
update](https://gist.githubusercontent.com/aminghadersohi/96dc57dd1b1bd0539d461f6d2d980f31/raw/dfaeaf85ed1acfe0b5cc04c63fa0201fa095e868/after_update_bar.png)
 | ![after 
remove](https://gist.githubusercontent.com/aminghadersohi/96dc57dd1b1bd0539d461f6d2d980f31/raw/79a8ef728ae293fdf6993d36bb30de2d8dc1cd5f/after_remove_bar.png)
 |
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to