rusackas opened a new pull request, #44043:
URL: https://github.com/apache/superset/pull/44043

   ### SUMMARY
   `GET /api/v1/dashboard/{pk}/filter_state/{key}` only ever returned the raw 
cached `value`. That value is a `DataMaskStateWithId` — a map keyed by filter 
id — not a flat object, so there's no `name`/label a client can read out of it 
directly (#36053). As discussed on the issue and on the prior attempt (#36262), 
the filter's human-readable label isn't part of the cached blob at all; it 
lives in the dashboard's `native_filter_configuration`.
   
   This cross-references the filter ids present in the cached `value` against 
the dashboard's `native_filter_configuration` and returns a `names` map (filter 
id -> label) alongside `value`, so a client can look up each filter's label 
without needing to separately fetch and parse the dashboard's filter 
configuration.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A - API response change only.
   
   Before:
   ```json
   {"value": 
"{\"NATIVE_FILTER-abc\":{\"id\":\"NATIVE_FILTER-abc\",\"extraFormData\":{}}}"}
   ```
   
   After:
   ```json
   {
     "value": 
"{\"NATIVE_FILTER-abc\":{\"id\":\"NATIVE_FILTER-abc\",\"extraFormData\":{}}}",
     "names": {"NATIVE_FILTER-abc": "My Filter Label"}
   }
   ```
   
   ### TESTING INSTRUCTIONS
   - `pytest tests/integration_tests/dashboards/filter_state/api_tests.py` — 
includes a new `test_get_dashboard_filter_state_includes_names` test that seeds 
a dashboard's `native_filter_configuration` and a matching cached filter_state 
entry (shaped like the real `DataMaskStateWithId`), then asserts the GET 
response includes the correct `names` map.
   - `pytest tests/unit_tests/dashboards/filter_state_api_test.py`
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #36053
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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