Repository navigation
feat(semantic-layer): allow toggling SEMANTIC_LAYERS at runtime - #45061
aminghadersohi merged 15 commits into
Conversation
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
CodeAnt PR Risk: Low Risk
Assessed commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #45061 +/- ##
===========================================
+ Coverage 56.04% 83.07% +27.03%
===========================================
Files 3027 3028 +1
Lines 196347 196462 +115
Branches 45855 45876 +21
===========================================
+ Hits 110038 163220 +53182
+ Misses 85257 30017 -55240
- Partials 1052 3225 +2173
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aminghadersohi
left a comment
There was a problem hiding this comment.
No blocking findings; CI is green and two non-blocking inline notes are below. The codeant TypeError thread on semantic_layers/api.py:92 is a false positive: BaseApi.response is a staticmethod, and calling the guard with the flag off returns 404 {"message":"Not found"}.
…emantic-layers-gate # Conflicts: # UPDATING.md
Address review r4215043471 by asserting disabled semantic datasets do not count as inaccessible. Document the bootstrap cache delay noted in r4215043488.
aminghadersohi
left a comment
There was a problem hiding this comment.
Approving at 628687f: the MCP dashboard test now fails if the semantic-view skip is removed, the bootstrap-cache delay is documented, and CI is green.
… enable semantic validation fixture
|
@mikebridge This now has merge conflicts with master after #45105 merged. Could you merge master? I'll merge once it's green. |
Retain both rollout notes and map disabled semantic chart targets to structured MCP availability responses introduced by master targeting.
SUMMARY
SEMANTIC_LAYERScould previously only be decided at boot. It can now be toggled at runtime: the flag is evaluated per request through the feature-flag hook (IS_FEATURE_ENABLED_FUNC), and the semantic-layer APIs are registered on every startup.When the flag is off, every entry point that reads semantic data refuses with "Semantic layers are not enabled." before any data access: chart data, dashboards, Explore, form-data and permalinks, the datasource API, async queries, cache warm-up, dashboard screenshots and thumbnails, and the MCP view tools. Existing role and object permissions still apply when it is on.
UPDATING.mdand the feature-flags docs.ENABLE_EXTENSIONSremains the deployment prerequisite for provider extensions. During a rolling upgrade, enable the flag at runtime only after all web and worker processes carry these guards.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
No visual redesign. Existing chart error rendering displays "Semantic layers are not enabled." while semantic datasource metadata is unavailable.
TESTING INSTRUCTIONS
SEMANTIC_LAYERS=False. Verify semantic API routes return 404 and that both API classes and their permission-view pairs are registered.IS_FEATURE_ENABLED_FUNChook, toggle the semantic flag on, off, then on without restarting. Verify normal behavior resumes when enabled, and that while disabled queries, warm-up, metadata, cached images and semantic MCP tools refuse access. Ordinary dataset queries continue to work.pytest tests/integration_tests/semantic_layers/api_flag_test.pyagainst an initialized test metadata DB,pytest tests/unit_tests/semantic_layers, and the focused chart, async-worker and MCP unit tests. Run Jest forsrc/components/Chart/Chart.test.tsx.ADDITIONAL INFORMATION
SEMANTIC_LAYERS🤖 Generated with Claude Code