You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2026/05/14 15:02:49 UTC

(superset) branch single-sv updated (06d91c3236f -> 671eed7863e)

This is an automated email from the ASF dual-hosted git repository.

betodealmeida pushed a change to branch single-sv
in repository https://gitbox.apache.org/repos/asf/superset.git


 discard 06d91c3236f feat(semantic layers): form for semantic layer with single semantic view
 discard 9a22cd49828 Improvements
 discard 044e8afed66 Leverage additive metrics
 discard 18e2f701467 feat(semantic layers): cache
     add 6cebba49ca0 fix(AlertReportModal): TypeError when pasting text into the Alerts content form search field (#39298)
     add 726d83d758d fix(mcp): remove stale created_by_fk filter references from MCP privacy layer (#39955)
     add 6a1305fe530 chore(deps): update zod requirement from ^4.4.1 to ^4.4.3 in /superset-frontend/plugins/plugin-chart-echarts (#40091)
     add 2c7e418d7bc chore(deps): bump @ant-design/icons from 6.2.2 to 6.2.3 in /docs (#40086)
     add 9e749da93c6 chore(deps): bump ws from 8.20.0 to 8.20.1 in /superset-websocket (#40085)
     add aebc6fbf344 chore(deps-dev): bump @types/node from 25.6.0 to 25.7.0 in /superset-websocket (#40052)
     add b4cb780e748 chore(deps): update ace-builds requirement from ^1.43.6 to ^1.44.0 in /superset-frontend/packages/superset-ui-core (#40017)
     add 5d40d8aeac7 chore(deps): bump actions/dependency-review-action from 4.9.0 to 5.0.0 (#40016)
     add 577085eeceb chore(deps-dev): bump fast-uri from 3.0.1 to 3.1.2 in /superset-embedded-sdk (#39978)
     add 8074ae2e38c chore(deps): bump fast-uri from 3.1.0 to 3.1.2 in /superset-frontend/cypress-base (#39974)
     add 803fed28b89 chore(deps): update react requirement from ^19.2.5 to ^19.2.6 in /superset-frontend/plugins/legacy-plugin-chart-chord (#39929)
     add cdddb99e9ac chore(deps): bump yeoman-generator from 8.1.2 to 8.2.2 in /superset-frontend (#39880)
     add 6216e574909 chore(deps): bump react-syntax-highlighter from 16.1.0 to 16.1.1 in /superset-frontend (#39698)
     add a50de459aea fix(dashboard): restore spacing for charts inside Tabs layout (#38729)
     add 85c44110414 chore(deps-dev): bump @babel/plugin-transform-modules-systemjs from 7.25.0 to 7.29.4 in /superset-embedded-sdk (#39983)
     add 1a7a14c3573 fix(explore): remove leftover debug console.log in ZoomConfigControl (#39991)
     add 817814d4f65 chore: Bump core packages to 0.1.0 (#40029)
     add 2a1dcb79e37 fix(mcp): expose table chart type labels in chart responses (#40060)
     add 958d4aa3dec fix(export): fix double app-root prefix in chart/drill-detail export URLs (#39710)
     add d7fa9301cca fix(dashboard): restore top-level tab drop target for dashboards with content (#39423)
     add 992f561ab9e chore(deps): bump mapbox-gl from 3.23.0 to 3.23.1 in /superset-frontend (#39879)
     add c233bf61713 chore(deps-dev): bump baseline-browser-mapping from 2.10.24 to 2.10.29 in /superset-frontend (#39903)
     add d6c458abd41 chore(deps-dev): bump oxlint from 1.62.0 to 1.63.0 in /superset-frontend (#39937)
     add d690aa7eb4c chore(deps): bump immer from 11.1.4 to 11.1.7 in /superset-frontend (#39941)
     add 17a5f693393 chore(deps): bump chrono-node from 2.9.0 to 2.9.1 in /superset-frontend (#39939)
     add 5bad4f55fb5 chore(deps-dev): bump @playwright/test from 1.59.1 to 1.60.0 in /superset-frontend (#40088)
     add 21e62d594eb chore(deps-dev): bump wait-on from 9.0.6 to 9.0.10 in /superset-frontend (#40087)
     add 676979643fe chore(deps-dev): bump @babel/preset-env from 7.29.3 to 7.29.5 in /superset-frontend (#39934)
     add 48530cb8884 chore(deps-dev): bump @babel/register from 7.28.6 to 7.29.3 in /superset-frontend (#39818)
     add d1e9a5df06c chore(docs): clean up version-cutting tooling and finish developer_portal rename (#39837)
     add 01224007daf fix(mixed-timeseries): preserve all-NaN metric columns after pivot when Jinja evaluates to NULL (#40005)
     add a62bf2b0bb7 fix: chart rendering race condition and homepage connection reset (#40065)
     add e56883baef6 fix(ci): handle schedule event in change_detector and actually trigger all-changed (#40105)
     add 64dae07675e chore(deps): bump markdown-to-jsx from 9.7.16 to 9.8.0 in /superset-frontend (#40111)
     new 671eed7863e feat(semantic layers): form for semantic layer with single semantic view

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (06d91c3236f)
            \
             N -- N -- N   refs/heads/single-sv (671eed7863e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .github/workflows/dependency-review.yml            |   2 +-
 .rat-excludes                                      |   3 +
 docs/DOCS_CLAUDE.md                                |  33 +-
 docs/README.md                                     |  56 +-
 docs/components/versions.json                      |   1 -
 docs/developer_docs/versions.json                  |   1 -
 docs/developer_portal_versions.json                |   1 -
 docs/package.json                                  |   8 +-
 docs/scripts/manage-versions.mjs                   | 259 ++++++--
 docs/src/theme/DocVersionBadge/index.js            |  28 +-
 docs/src/theme/DocVersionBanner/index.js           | 121 ----
 docs/src/theme/DocVersionBanner/styles.module.css  |  49 --
 docs/tutorials_versions.json                       |   3 -
 docs/yarn.lock                                     |   8 +-
 scripts/change_detector.py                         |  16 +-
 superset-core/pyproject.toml                       |   2 +-
 .../src/superset_core/semantic_layers/types.py     |  21 -
 superset-embedded-sdk/package-lock.json            | 568 ++++++-----------
 superset-extensions-cli/pyproject.toml             |   2 +-
 superset-frontend/cypress-base/package-lock.json   |  12 +-
 superset-frontend/package-lock.json                | 290 ++++-----
 superset-frontend/package.json                     |  20 +-
 .../packages/generator-superset/package.json       |   2 +-
 .../packages/superset-core/package.json            |   4 +-
 .../packages/superset-ui-core/package.json         |   4 +-
 .../src/chart/components/createLoadableRenderer.ts | 130 ++--
 .../plugins/legacy-plugin-chart-chord/package.json |   2 +-
 .../plugins/legacy-plugin-chart-rose/src/Rose.ts   |  11 +-
 .../plugins/plugin-chart-echarts/package.json      |   2 +-
 .../plugin-chart-point-cluster-map/package.json    |   2 +-
 .../Chart/DrillDetail/DrillDetailPane.tsx          |   3 +-
 .../src/components/Chart/chartAction.ts            |  21 +-
 .../src/components/Chart/chartActions.test.ts      |  72 +++
 .../DashboardBuilder/DashboardBuilder.test.tsx     |  43 ++
 .../DashboardBuilder/DashboardBuilder.tsx          |   7 +-
 superset-frontend/src/embedded/index.tsx           |   8 +-
 .../ZoomConfigControl/ZoomConfigControl.tsx        |   1 -
 .../src/explore/exploreUtils/exportChart.test.ts   |  26 +-
 .../src/explore/exploreUtils/index.ts              |  15 +-
 .../src/features/alerts/AlertReportModal.test.tsx  |  24 +
 .../src/features/alerts/AlertReportModal.tsx       |   9 +-
 .../Spin/index.tsx => src/types/emotion-jest.d.ts} |   2 +-
 superset-frontend/src/views/index.tsx              |   7 +-
 superset-frontend/src/views/menu.tsx               |  39 +-
 superset-websocket/package-lock.json               |  44 +-
 superset-websocket/package.json                    |   4 +-
 superset/mcp_service/chart/chart_utils.py          |  11 +
 superset/mcp_service/chart/schemas.py              |   6 +
 superset/mcp_service/chart/tool/generate_chart.py  |   2 +
 .../explore/tool/generate_explore_link.py          |   6 +
 superset/mcp_service/privacy.py                    |  31 +-
 superset/semantic_layers/cache.py                  | 709 ---------------------
 superset/semantic_layers/mapper.py                 |  44 +-
 superset/utils/pandas_postprocessing/pivot.py      |  78 ++-
 .../mcp_service/chart/test_chart_schemas.py        |  16 +
 .../mcp_service/chart/test_chart_utils.py          |  22 +
 .../mcp_service/chart/tool/test_generate_chart.py  |  55 +-
 .../explore/tool/test_generate_explore_link.py     |  35 +
 .../unit_tests/pandas_postprocessing/test_pivot.py | 243 +++++++
 .../semantic_layers/cache_integration_test.py      | 295 ---------
 tests/unit_tests/semantic_layers/cache_test.py     | 709 ---------------------
 61 files changed, 1499 insertions(+), 2749 deletions(-)
 delete mode 100644 docs/components/versions.json
 delete mode 100644 docs/developer_docs/versions.json
 delete mode 100644 docs/developer_portal_versions.json
 delete mode 100644 docs/src/theme/DocVersionBanner/index.js
 delete mode 100644 docs/src/theme/DocVersionBanner/styles.module.css
 delete mode 100644 docs/tutorials_versions.json
 copy superset-frontend/{packages/superset-ui-core/src/components/Spin/index.tsx => src/types/emotion-jest.d.ts} (95%)
 delete mode 100644 superset/semantic_layers/cache.py
 delete mode 100644 tests/unit_tests/semantic_layers/cache_integration_test.py
 delete mode 100644 tests/unit_tests/semantic_layers/cache_test.py


(superset) 01/01: feat(semantic layers): form for semantic layer with single semantic view

Posted by be...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

betodealmeida pushed a commit to branch single-sv
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 671eed7863e7cb9461f844339fb5b0fc47e220f4
Author: Beto Dealmeida <ro...@dealmeida.net>
AuthorDate: Wed May 13 15:14:51 2026 -0400

    feat(semantic layers): form for semantic layer with single semantic view
---
 .../features/semanticLayers/jsonFormsHelpers.tsx   | 91 +++++++++++++++++++++-
 .../semanticViews/AddSemanticViewModal.tsx         | 32 +++++++-
 2 files changed, 118 insertions(+), 5 deletions(-)

diff --git a/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx b/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx
index 85c7b891dbc..7368f61ceec 100644
--- a/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx
+++ b/superset-frontend/src/features/semanticLayers/jsonFormsHelpers.tsx
@@ -255,14 +255,98 @@ const EnumNamesRenderer = withJsonFormsControlProps(EnumNamesControl);
 const enumNamesEntry = {
   // Rank 5: higher than the default string renderer (2–3) so this fires
   // whenever x-enumNames is present, regardless of the underlying type.
+  // Array-of-enum schemas are handled by ``multiEnumEntry`` below — this
+  // renderer only targets scalar string/number controls.
   tester: rankWith(
     5,
+    and(
+      schemaMatches(s => {
+        const names = (s as Record<string, unknown>)['x-enumNames'];
+        return Array.isArray(names) && (names as unknown[]).length > 0;
+      }),
+      schemaMatches(
+        s => (s as Record<string, unknown>)?.type !== 'array',
+      ),
+    ),
+  ),
+  renderer: EnumNamesRenderer,
+};
+
+/**
+ * Renderer for ``{type: 'array', items: {enum: [...]}}`` schemas.  Renders
+ * a single Antd Select with ``mode="multiple"`` (tag-style multi-select),
+ * matching the natural expectation of a "pick several from a list" control.
+ *
+ * Without this, the default ``PrimitiveArrayControl`` from the upstream
+ * library renders an "Add …" button that creates one single-select per
+ * element — visually wrong for an enum multi-select and unable to display
+ * ``items.x-enumNames`` labels.
+ *
+ * The renderer is dynamic-aware: when the host form is refreshing the
+ * schema (e.g. compatible options narrowing as the user picks), the Select
+ * shows a loading indicator without becoming disabled, so the user can
+ * continue editing while options refresh.
+ */
+function MultiEnumControl(props: ControlProps) {
+  const { refreshingSchema } = props.config ?? {};
+  const arraySchema = props.schema as Record<string, unknown>;
+  const itemsSchema =
+    (arraySchema.items as Record<string, unknown>) ??
+    ({} as Record<string, unknown>);
+
+  const enumValues = (itemsSchema.enum as unknown[]) ?? [];
+  const enumNames =
+    (itemsSchema['x-enumNames'] as string[]) ?? enumValues.map(String);
+
+  const options = enumValues.map((value, index) => ({
+    value: value as string | number,
+    label: enumNames[index] ?? String(value),
+  }));
+
+  const value = Array.isArray(props.data) ? (props.data as unknown[]) : [];
+
+  const tooltip = (props.uischema?.options as Record<string, unknown>)
+    ?.tooltip as string | undefined;
+
+  return (
+    <Form.Item label={props.label} tooltip={tooltip}>
+      <Select
+        mode="multiple"
+        value={value as (string | number)[]}
+        onChange={next => props.handleChange(props.path, next)}
+        options={options}
+        style={{ width: '100%' }}
+        disabled={!props.enabled}
+        loading={!!refreshingSchema}
+        allowClear
+        optionFilterProp="label"
+        placeholder={
+          (props.uischema?.options as Record<string, unknown>)
+            ?.placeholderText as string | undefined
+        }
+      />
+    </Form.Item>
+  );
+}
+const MultiEnumRenderer = withJsonFormsControlProps(MultiEnumControl);
+const multiEnumEntry = {
+  // Rank 35: must beat upstream ``PrimitiveArrayRenderer`` (rank 30) so an
+  // ``array``/``items.enum`` schema renders as one Antd multi-select tag
+  // box instead of the "Add" repeater pattern that PrimitiveArray uses.
+  tester: rankWith(
+    35,
     schemaMatches(s => {
-      const names = (s as Record<string, unknown>)['x-enumNames'];
-      return Array.isArray(names) && (names as unknown[]).length > 0;
+      const schema = s as Record<string, unknown>;
+      if (schema?.type !== 'array') return false;
+      const items = schema.items as Record<string, unknown> | undefined;
+      return (
+        !!items &&
+        Array.isArray(items.enum) &&
+        (items.enum as unknown[]).length > 0
+      );
     }),
   ),
-  renderer: EnumNamesRenderer,
+  renderer: MultiEnumRenderer,
 };
 
 export const renderers = [
@@ -271,6 +355,7 @@ export const renderers = [
   constEntry,
   readOnlyEntry,
   enumNamesEntry,
+  multiEnumEntry,
   dynamicFieldEntry,
 ];
 
diff --git a/superset-frontend/src/features/semanticViews/AddSemanticViewModal.tsx b/superset-frontend/src/features/semanticViews/AddSemanticViewModal.tsx
index e85900c0b92..4bdc7bf37d3 100644
--- a/superset-frontend/src/features/semanticViews/AddSemanticViewModal.tsx
+++ b/superset-frontend/src/features/semanticViews/AddSemanticViewModal.tsx
@@ -456,6 +456,30 @@ export default function AddSemanticViewModal({
   const viewsDisabled =
     loadingViews || (!loadingViews && availableViews.length === 0);
 
+  // When ``x-singleView: true`` the runtime form fully describes a single
+  // semantic view (e.g. a MetricFlow cube).  Hide the picker and auto-select
+  // whatever ``get_semantic_views`` returned so the Add button can fire
+  // without an extra user click.
+  const singleViewMode =
+    (runtimeSchema as Record<string, unknown> | null)?.['x-singleView'] ===
+    true;
+
+  useEffect(() => {
+    if (!singleViewMode) return;
+    const namesToAdd = availableViews
+      .filter(v => !v.already_added)
+      .map(v => v.name);
+    setSelectedViewNames(prev => {
+      if (
+        prev.length === namesToAdd.length &&
+        prev.every((n, i) => n === namesToAdd[i])
+      ) {
+        return prev;
+      }
+      return namesToAdd;
+    });
+  }, [singleViewMode, availableViews]);
+
   return (
     <StandardModal
       show={show}
@@ -511,8 +535,12 @@ export default function AddSemanticViewModal({
           </>
         )}
 
-        {/* Semantic Views — always visible once a layer is selected */}
-        {selectedLayerUuid && !loadingRuntime && (
+        {/* Semantic Views — always visible once a layer is selected, unless
+            the runtime schema declares ``x-singleView: true``: extensions
+            (e.g. MetricFlow cubes) whose runtime form fully describes a
+            single view set that flag so the picker disappears and the
+            view is auto-selected when ``get_semantic_views`` returns it. */}
+        {selectedLayerUuid && !loadingRuntime && !singleViewMode && (
           <ModalFormField label={t('Semantic Views')}>
             <Select
               ariaLabel={t('Semantic views')}