feat(semantic layers): form for SL with a single SV#40280
Conversation
Code Review Agent Run #b75eb4Actionable Suggestions - 0Additional Suggestions - 1
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40280 +/- ##
=======================================
Coverage 64.19% 64.19%
=======================================
Files 2591 2591
Lines 138392 138429 +37
Branches 32109 32125 +16
=======================================
+ Hits 88837 88871 +34
- Misses 48025 48028 +3
Partials 1530 1530
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review Agent Run #9c60cb
Actionable Suggestions - 1
-
superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx - 1
- Missing unit tests for MultiEnumControl · Line 275-330
Review Details
-
Files reviewed - 2 · Commit Range:
137c9fc..3ce15e0- superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx
- superset-frontend/src/features/semanticViews/AddSemanticViewModal.tsx
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.
Documentation & Help
|
Bito Automatic Review Skipped – PR Already Merged |
SUMMARY
Adds two pieces of UX plumbing so semantic-layer extensions can ship a runtime form that fully describes a single view (think MetricFlow cubes), and so any runtime form that exposes a "pick several from a fixed list" field renders the right control.
Changes
superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsxNew JSON Forms renderer
MultiEnumControlfor schemas of the shape:{ "type": "array", "items": { "enum": [...], "x-enumNames": [...] } }<Select mode="multiple">(tag-style multi-pick).items.x-enumNamesfor display labels, falling back to the raw enum value.config.refreshingSchemaflag: the control shows a loading indicator while the schema is being re-fetched (e.g. dependent options narrowing as the user picks), without becoming disabled.35so it beats upstreamPrimitiveArrayControl(rank30), which previously rendered a misleading "Add …" repeater of single selects that couldn't surfacex-enumNames.enumNamesEntry(scalarx-enumNamesrenderer) is narrowed to only fire whenschema.type !== 'array', so the new array entry owns the multi-select case.superset-frontend/src/features/semanticViews/AddSemanticViewModal.tsxAdds support for a top-level
x-singleView: trueflag on a layer's runtime schema. When set, the layer is treated as describing exactly one semantic view:get_semantic_viewsreturns, the first not-yet-added view is auto-selected so the Add button can fire without an extra click.setSelectedViewNames), so it doesn't re-render the modal in a loop.Also fixes a small bug in the "no runtime config" path of the layer-selection effect: previously, when a layer's runtime schema had no
propertieswe skippedapplyRuntimeSchema(schema)and went straight tofetchViews, which threw away top-level metadata likex-singleView. We now callapplyRuntimeSchema(schema)first, then fetch views.Why this matters
Extensions like MetricFlow expose layers that are a single cube — there is no list of views to pick from. Before this branch, the modal forced the user through an empty-but-required picker. With
x-singleView, the runtime form fully drives the Add flow.MultiEnumControlis a generic prerequisite: those same single-view runtime schemas commonly include "select N tags / N dimensions" array-of-enum fields, and the upstream PrimitiveArray renderer wasn't usable for them.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
x-singleView: behavior unchanged — picker is shown, manual selection required.x-singleView: trueand a non-empty runtime form: picker is hidden; onceget_semantic_viewsresolves, the first available view is preselected and Add is enabled.properties:x-singleViewis still honored (picker hidden, view auto-selected).array/items.enumfield renders an Antd tag-style multi-select usingx-enumNamesfor labels; the control shows a loading spinner during schema refresh without disabling editing.ADDITIONAL INFORMATION