Skip to content

Commit a7eb574

Browse files
authored
Merge branch 'master' into issue-45063
2 parents 48d5079 + 2350348 commit a7eb574

146 files changed

Lines changed: 11519 additions & 1564 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/superset-translations.yml‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,21 +109,17 @@ jobs:
109109
- name: Fetch base ref and create comparison worktree
110110
if: steps.check.outputs.python == 'true' || steps.check.outputs.frontend == 'true'
111111
env:
112-
PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
113112
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114113
run: |
115114
# The checkout above does not persist credentials, and an anonymous
116115
# fetch only works against a public repository. Authenticate this
117116
# one fetch so the comparison also works in private forks/mirrors.
118117
AUTH_HEADER="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$GH_TOKEN" | base64 | tr -d '\n')"
119-
# For PRs use the base branch; for direct pushes compare against the previous commit.
120-
BASE_REF="$PR_BASE_REF"
121-
if [ -n "$BASE_REF" ]; then
122-
git -c "http.extraheader=$AUTH_HEADER" fetch --depth=1 origin "$BASE_REF"
123-
else
124-
git -c "http.extraheader=$AUTH_HEADER" fetch --depth=2 origin "$GITHUB_REF"
125-
fi
126-
git worktree add /tmp/base-worktree FETCH_HEAD
118+
# Compare against the first parent of the checked-out commit: the
119+
# base commit the PR merge ref was built on, or the previous commit
120+
# for a direct push.
121+
git -c "http.extraheader=$AUTH_HEADER" fetch --depth=2 origin "$GITHUB_SHA"
122+
git worktree add /tmp/base-worktree "$GITHUB_SHA^1"
127123
128124
# Run babel_update against BASE source + BASE translations. Any drift
129125
# already present on the base branch (source strings that have changed

‎UPDATING.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ assists people when migrating to a new version.
2424

2525
## Next
2626

27+
- Webhook alerts/reports and the Impala `cancel_query` call now share
28+
`get_ssrf_safe_requester`, whose session sets `trust_env=False`. Unless
29+
`ALERT_REPORTS_WEBHOOK_ALLOW_INTERNAL_HOSTS` / `IMPALA_CANCEL_QUERY_ALLOW_INTERNAL_HOSTS`
30+
is `True`, these requests no longer honor `HTTP(S)_PROXY`/`NO_PROXY`,
31+
`REQUESTS_CA_BUNDLE`/`CURL_CA_BUNDLE`, or `.netrc`, because proxied connections
32+
would bypass the connected-peer validation. Deployments that must reach webhooks
33+
through a proxy or custom CA bundle should set the matching allow-internal flag,
34+
which restores the plain `requests` behavior (and skips peer validation).
35+
2736
- MCP `update_dashboard` rejects blank or whitespace-only `dashboard_title`
2837
values with "Text must not be empty"; omit the field to keep the stored title.
2938
MCP chart names and theme names are capped at 250 characters, matching their

‎docs/admin_docs/configuration/mcp-server.mdx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,8 +2449,9 @@ whitespace-only input. A title containing only removed HTML/script content
24492449
(`unsafe_text`), not an empty-text error. Optional titles on creation retain
24502450
their existing empty-value behavior, including whitespace-only values longer
24512451
than the title limit. On creation, blank chart names fall back to generated
2452-
names; whitespace-only dashboard titles fall back to chart-based titles, while
2453-
an explicit empty string is preserved. `update_dashboard` rejects explicit blank
2452+
names; `generate_dashboard` falls back to chart-based titles when
2453+
`dashboard_title` (or its `title` / `name` alias) is omitted, empty, or
2454+
whitespace-only. `update_dashboard` rejects explicit blank
24542455
or whitespace-only dashboard renames with "Text must not be empty"; omitting
24552456
`dashboard_title` leaves the stored title unchanged.
24562457

‎docs/admin_docs/security/security.mdx‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,25 @@ has important implications when working with virtual (SQL-based) datasets:
696696
Additionally, RLS filters on the **underlying physical datasets** referenced by the
697697
virtual dataset's SQL are injected into the inner subquery for each referenced table.
698698

699+
When `ALLOW_ADHOC_SUBQUERY` is enabled, subqueries in chart columns, metrics and filters
700+
also receive the referenced datasets' RLS filters, and those filters contribute to the
701+
chart's cache key. Each predicate is associated with its qualified table in the
702+
cache key, so different assignments of the same predicates to different tables do
703+
not share cached results. For unqualified table names on engines that cannot change schema
704+
per query, the connection's execution schema takes precedence when it can be
705+
discovered. The configured dataset schema remains the fallback for RLS lookup and
706+
cache keys when neither the connection parameters nor the inspector yields a schema.
707+
Expression RLS cache keys are collected without building the chart query or running
708+
series-limit prequeries; schema discovery is shared with the dataset SQL's RLS lookup.
709+
For predicate discovery, each expression template is rendered with the context query
710+
execution uses (including a series-limit prequery's), before the cache lookup and
711+
without calling warehouse or viewer-dependent macros. Template parameters and the macros
712+
that only read the request's filters and URL parameters (`filter_values`, `get_filters`,
713+
`url_param`) are evaluated. Other macros, such as `presto.latest_partition`, `dataset`,
714+
`metric`, `get_time_filter` and the `current_user_*` functions, are not called: an
715+
expression that uses one gets a cache key scoped to the current user instead of RLS
716+
predicates. Literal template syntax produced by a template is not evaluated again.
717+
699718
For example, if you have:
700719

701720
1. A physical dataset `orders` with RLS filter `region = 'US'`

‎docs/developer_docs/extensions/extension-points/semantic-layers.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ provider test processes, not a live host. An executable, SDK-only example is in
147147
It demonstrates discovery and values only; unsupported table/count queries are
148148
explicitly refused, not claimed as a full provider implementation.
149149

150+
See [Testing semantic providers](../../semantic-layer-provider-testing.md) for the
151+
reusable SDK conformance suite and its provider-owned fixtures.
152+
150153
## Execution context
151154

152155
The unreleased SDK uses one `SemanticLayer.from_configuration` factory with
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
---
2+
title: Testing semantic providers
3+
---
4+
5+
<!--
6+
Licensed to the Apache Software Foundation (ASF) under one
7+
or more contributor license agreements. See the NOTICE file
8+
distributed with this work for additional information
9+
regarding copyright ownership. The ASF licenses this file
10+
to you under the Apache License, Version 2.0 (the
11+
"License"); you may not use this file except in compliance
12+
with the License. You may obtain a copy of the License at
13+
14+
http://www.apache.org/licenses/LICENSE-2.0
15+
16+
Unless required by applicable law or agreed to in writing,
17+
software distributed under the License is distributed on an
18+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19+
KIND, either express or implied. See the License for the
20+
specific language governing permissions and limitations
21+
under the License.
22+
-->
23+
24+
# Testing semantic providers
25+
26+
The optional `superset_core.semantic_layers.testing` pytest plugin supplies
27+
`semantic_layer_registration` and `SemanticProviderConformance`. Install pytest
28+
alongside the SDK's dependencies; the normal SDK import does not load pytest.
29+
Run the suite in an isolated provider test process without a Superset application.
30+
31+
Load the plugin before test collection so pytest can rewrite its assertions:
32+
33+
```bash
34+
pytest -p superset_core.semantic_layers.testing path/to/provider_tests
35+
```
36+
37+
Inherit the suite in your own test module:
38+
39+
```python
40+
from superset_core.semantic_layers.testing import SemanticProviderConformance
41+
42+
class TestMyProvider(SemanticProviderConformance):
43+
pass
44+
```
45+
46+
Provide these function-scoped pytest fixtures. Import decorated provider modules
47+
inside fixtures that depend on `semantic_layer_registration`, not at collection
48+
time. The fixture bypasses only decoration; host registration and lifecycle need
49+
separate integration tests.
50+
51+
| Fixture | Value and responsibility |
52+
| --- | --- |
53+
| `semantic_view` | A real SDK view over a small deterministic backend dataset. |
54+
| `semantic_reloaded_view` | A separately constructed view of the same catalog and identity. |
55+
| `semantic_query_cases` | Mapping from each required case below to `(SemanticQuery, expected_arrow_table)`. Expected results must be independently calculated, not obtained from the provider under test. |
56+
| `semantic_error_cases` | Mapping from `method:kind` to a no-argument callable that executes the actual provider method against a controlled backend outcome. Methods: `get_table`, `get_values`, `get_row_count`; kinds: `refusal`, `fault`, `incomplete`, `unverified`. Do not supply closures that simply raise the expected SDK exception. |
57+
| `semantic_capability_cases` | One `(query, expected_table)` per advertised feature value, exercising the feature. Use a positive offset and limit for `ROW_OFFSET`; use an actual group limit for `GROUP_LIMIT`/`GROUP_OTHERS`, an `AdhocExpression` order key for `ADHOC_EXPRESSIONS_IN_ORDERBY`. Features run as separate parametrized cases; unadvertised features are skipped. `ADHOC_COLUMN_EXPRESSIONS` is always skipped with "no SDK query shape yet": `SemanticQuery.dimensions` accepts only `Dimension`, and the host rejects ad-hoc dimensions. No fixture entry is required for that feature; its skip is unverified coverage, not a passing capability check. |
58+
| `semantic_make_view` | Callable taking an opaque string token, constructing/discovering a view through the provider's binding path. Adapt the factory of your supported SDK version here. An uncached test adapter may construct a view directly; cached providers must exercise the actual binding/discovery path. |
59+
| `semantic_change_catalog` | No-argument callable changing the controlled source catalog: add a visible member on every call, without clearing provider caches. |
60+
| `semantic_provider_class` | `(importable_module_name, class_name)` of the layer for an isolated import and static-schema check. Dependencies must already be installed. |
61+
62+
Required query cases are `identity`, `grain`, `null`, `not_null`, `or`, and
63+
`order_limit`. Use member names distinct from private IDs and display labels.
64+
For `grain`, use a grain-bearing dimension with data whose aggregation distinguishes the selected grain from raw values. Multiple grain variants for one name are allowed, not required. When the catalog declares no grain-bearing dimension, the case skips with an explicit reason before looking up its fixture entry; such providers may omit the `grain` entry. This reports unexercised grain coverage, not a passing grain check.
65+
NULL and grouped-OR fixtures must select NULL and non-NULL branches observably;
66+
the `or` case must use the host-normalized shape: one `OrFilter` containing
67+
`IN frozenset({value_a, value_b, ...})` (at least two non-NULL values) and
68+
`IS_NULL` for the same member, combined with an outer AND comparison in the same
69+
predicate stage. Seed data so both IN values and the NULL branch contribute,
70+
and removing the parentheses or dropping the outer comparison changes the result.
71+
Also seed an excluded non-NULL category that satisfies the outer comparison,
72+
so dropping the whole OR group changes the result.
73+
The SQLite example uses a February lower bound, with A and NULL rows on both sides
74+
of that bound: the correct totals are NULL=1, A=5, B=8. This distinguishes either
75+
ordering of the outer AND and the OR group. A February C row with amount 6 must
76+
be excluded; dropping the OR group incorrectly adds C=6 to the result.
77+
Seed more result rows than the limit, in an order that differs from the requested
78+
sort. The suite compares exact Arrow column names, types, values and row order,
79+
without prescribing column order or field nullability.
80+
Expected tables must be nonempty so a provider returning no data cannot pass.
81+
Multi-row query and capability cases must supply explicit order keys that totally
82+
order the expected rows, without ties. Do not rely on where NULLs sort unless the
83+
provider defines that behavior; the example orders nullable groups by their
84+
non-null, distinct metric values.
85+
86+
The catalog check detects duplicate metric names, duplicate dimension name/grain
87+
pairs, metric/dimension name collisions, and unstable selection names across
88+
reloads. It does not make private IDs or display labels into selection keys.
89+
The metadata test changes the source between two string-token generations.
90+
The change fixture must retain every existing metric and dimension name/grain
91+
pair and add at least one member; an empty, shrunken or unchanged second catalog
92+
fails. For views that echo a token, the test checks that the first view never
93+
claims the later generation. Legacy views can report `None`; freshness is still
94+
checked, but token relabeling cannot be verified for those views.
95+
96+
The error lane asserts closed SDK refusal/completeness categories, not HTTP
97+
status codes, host exception types or presentation messages. Fault cases reject
98+
common programming errors (`TypeError`, `AttributeError`, `NameError`,
99+
`AssertionError`, `KeyError`) as well as refusal/completeness exceptions; provider
100+
lanes should additionally assert their backend-specific fault type. If a backend cannot
101+
produce a particular `method:kind` outcome, override `test_error_categories`,
102+
explicitly skip only that case with the backend-specific reason, and delegate
103+
all other cases to `super().test_error_categories(...)`. Repeat both base
104+
`@pytest.mark.parametrize` decorators on the override, with the same method and
105+
kind lists: pytest does not inherit those marks onto an overriding method.
106+
Record such skips as
107+
unverified release-gate coverage, not passing conformance; do not fabricate an
108+
SDK exception just to fill the matrix. The count lane only
109+
checks failure propagation; it does not settle pending count or value-shape
110+
rules. Construction fixtures avoid copying a factory signature or context type.
111+
The host supplies default chronological ordering before calling the provider.
112+
This suite checks the provider obligation to honor explicit ordering before limit
113+
and offset, including the ordered grain case.
114+
115+
The import/schema check starts a fresh Python interpreter with the test import
116+
path. It rejects imports of `superset`, `flask` and `flask_appbuilder`, including
117+
transitive imports through SDK modules that depend on those frameworks, and calls
118+
both no-configuration schema forms with common file-opening, DNS and socket
119+
connection operations blocked. Caught attempts fail too. This is a regression
120+
tripwire, not a sandbox or proof against every possible I/O mechanism (for example,
121+
a native driver). Provider lanes must also replace their own transport/credential
122+
entry points with failures to prove schema generation cannot call them.
123+
124+
The SDK-only examples live in `superset-core/tests/semantic_layers/`: the minimal
125+
`example_provider.py` demonstrates registration and discovery; `conformance_provider.py`
126+
and `test_conformance.py` show an in-memory SQLite backend with controlled failures
127+
and explicit expected answers. SQLite runs in-process, with no server or credentials.
128+
The example does not define new count semantics or production caching machinery.
129+
130+
Run the examples from the repository root:
131+
132+
```bash
133+
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 PYTHONPATH=$PWD/superset-core/src python -m pytest -p superset_core.semantic_layers.testing -q -o addopts='' superset-core/tests/semantic_layers/test_conformance.py
134+
```
135+
136+
Passing this suite is a provider-level check, not a claim that a deployed host,
137+
MCP caller, authorization policy, or live warehouse works. Each provider must
138+
supply honest discriminating fixtures and retain its host caller and live-provider
139+
lanes. Provider-lane wiring must use the actual pinned SDK, never copied types.

‎docs/docs/using-superset/sql-templating.mdx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ FROM sales_data
116116
WHERE sales_rep = '{{ current_username() }}'
117117
```
118118

119+
When these user-context macros appear in a dataset's row-level security rules,
120+
column-value suggestions and chart-backed annotations include the rendered RLS
121+
predicates in their cache keys. Viewers sharing a rule template do not share
122+
those cached results when the rendered predicates differ.
123+
119124
**Example: Role-based access**
120125

121126
```sql

‎docs/docs/using-superset/using-ai-with-superset.mdx‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ MCP Vega-Lite previews of grouped time-series charts retain each series from
9999
post-processed chart data, including charts with multiple grouping dimensions.
100100
Saved line, bar, area, and scatter previews honor the requested width and height
101101
and include the chart name in their description.
102+
Chart filters on the selected temporal column apply independently of the chart's
103+
time range, including Big Number trendlines and generated or updated previews.
104+
Dashboard-scoped dataset queries refuse a time-column override that would discard
105+
a caller or dashboard predicate on a different temporal column. Use that filtered
106+
column as `time_column`, or query the dashboard's charts.
102107
When rebuilding queries for saved charts without a query context, MCP honors
103108
resampling across the requested time range, inherited table time comparisons,
104109
and temporal column references for semantic views. A matching inherited table

‎docs/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"@fontsource/fira-code": "^5.3.0",
5757
"@fontsource/ibm-plex-mono": "^5.3.0",
5858
"@fontsource/inter": "^5.3.0",
59-
"@storybook/addon-docs": "^10.6.2",
59+
"@storybook/addon-docs": "^10.6.3",
6060
"@superset-ui/core": "^0.20.4",
6161
"@swc/core": "^1.16.18",
6262
"antd": "^6.6.7",
@@ -72,7 +72,7 @@
7272
"react-svg-pan-zoom": "^3.13.1",
7373
"react-table": "^7.8.0",
7474
"remark-import-partial": "^0.0.2",
75-
"storybook": "^10.6.2",
75+
"storybook": "^10.6.3",
7676
"swagger-ui-react": "^5.34.0",
7777
"swc-loader": "^0.2.7",
7878
"tinycolor2": "^1.6.0",

‎docs/yarn.lock‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4145,14 +4145,14 @@
41454145
resolved "https://registry.yarnpkg.com/@standard-schema/utils/-/utils-0.3.0.tgz#3d5e608f16c2390c10528e98e59aef6bf73cae7b"
41464146
integrity sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==
41474147

4148-
"@storybook/addon-docs@^10.6.2":
4149-
version "10.6.2"
4150-
resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-10.6.2.tgz#393910044c4743f7fb1b48a9bd19012c205975cd"
4151-
integrity sha512-f7Rv/rzX1sk4lUDTeoIRkXWcWvNwLv7vBnfpFGb3f88MliB+M4ZekGKNiKtrmi44uLFt52gzwwPzj2eGDu0DQQ==
4148+
"@storybook/addon-docs@^10.6.3":
4149+
version "10.6.3"
4150+
resolved "https://registry.yarnpkg.com/@storybook/addon-docs/-/addon-docs-10.6.3.tgz#24a8bfa2f2f56a23b031ae5e3196bd36fcd6dc7c"
4151+
integrity sha512-365f712au4w/xvFqEKY6TIvTeGGAY7FKRB8zP4CFa3VSv9oyxHaq/ublFg4YDbCeRagppwl1PZ6k4+PoUor3+A==
41524152
dependencies:
41534153
"@mdx-js/react" "^3.0.0"
41544154
"@storybook/icons" "^2.0.2"
4155-
"@storybook/react-dom-shim" "10.6.2"
4155+
"@storybook/react-dom-shim" "10.6.3"
41564156
react "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
41574157
react-dom "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
41584158
ts-dedent "^2.0.0"
@@ -4168,10 +4168,10 @@
41684168
resolved "https://registry.yarnpkg.com/@storybook/icons/-/icons-2.1.0.tgz#edfc2450a39c5e780f28c6cbc49acd7bff59b41a"
41694169
integrity sha512-Fxh9vYpX9bQqFeHRiY8h2ApeRGDzRSMLwJwNZ/AIRqnyOKHxRKL+yFe+ctEkVJmuptRE9u1Hrn8ZZNHyfDKKNg==
41704170

4171-
"@storybook/react-dom-shim@10.6.2":
4172-
version "10.6.2"
4173-
resolved "https://registry.yarnpkg.com/@storybook/react-dom-shim/-/react-dom-shim-10.6.2.tgz#863ffe89bad54ef16e4bf01af536137577e8365b"
4174-
integrity sha512-k0262Vqxjk3wHeg3g/QO/ENDrkC7kkbuwsFSXOdYr7Sl888tsF1DAS7uQ/gr+s/BRz1FLYRX7wBY3smEUV4MJg==
4171+
"@storybook/react-dom-shim@10.6.3":
4172+
version "10.6.3"
4173+
resolved "https://registry.yarnpkg.com/@storybook/react-dom-shim/-/react-dom-shim-10.6.3.tgz#a1bb83fd39bd68eb6a8703d60c6e4296f19debf9"
4174+
integrity sha512-cJUuPrieiTl06kzlgaU89iG+CtLAgUTt0Xdvm8qFT9yR2qwafSaswhwYWlZCNX4nWuOu7eK7uzWTwzKqyDBOWQ==
41754175

41764176
"@superset-ui/core@^0.20.4":
41774177
version "0.20.4"
@@ -13978,10 +13978,10 @@ std-env@^3.7.0:
1397813978
resolved "https://registry.yarnpkg.com/std-env/-/std-env-3.10.0.tgz#d810b27e3a073047b2b5e40034881f5ea6f9c83b"
1397913979
integrity sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==
1398013980

13981-
storybook@^10.6.2:
13982-
version "10.6.2"
13983-
resolved "https://registry.yarnpkg.com/storybook/-/storybook-10.6.2.tgz#317b3e942896dc9f10a114ae7a88d75c81e48d70"
13984-
integrity sha512-qHDINMiapxFUxYb+xC3j8u7Y+85X3u+/PlytE/wmnyg+bU0agCW3jUmWP4vIh2MioO2jTK/2B3Lcw6IpRFzQBA==
13981+
storybook@^10.6.3:
13982+
version "10.6.3"
13983+
resolved "https://registry.yarnpkg.com/storybook/-/storybook-10.6.3.tgz#be8aa415fc3df07c7998ee3857eda35c8b659d3d"
13984+
integrity sha512-lNBvcZFG44C98KvQHYzfq1O46m+sl94zY1+na5/9E3ihtNMbvpOgYyMFMIcWYUvOMo3OM4q9jzvB73KU20bU8w==
1398513985
dependencies:
1398613986
"@storybook/global" "^5.0.0"
1398713987
"@storybook/icons" "^2.0.2"

0 commit comments

Comments
 (0)