Skip to content

Commit 9ceb6fa

Browse files
authored
Merge branch 'master' into feat/enforce-min-release-age-for-npm-dep-installation
2 parents 71150a1 + b7301ac commit 9ceb6fa

208 files changed

Lines changed: 4881 additions & 950 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/dependabot.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ updates:
55
directory: "/"
66
schedule:
77
interval: "daily"
8+
groups:
9+
security:
10+
applies-to: "security-updates"
11+
patterns: ["*"]
812
cooldown:
913
default-days: 7
1014

@@ -61,6 +65,9 @@ updates:
6165
- npm
6266
- dependabot
6367
groups:
68+
security:
69+
applies-to: "security-updates"
70+
patterns: ["*"]
6471
rjsf:
6572
patterns:
6673
- "@rjsf/*"
@@ -98,13 +105,21 @@ updates:
98105
labels:
99106
- pip
100107
- dependabot
108+
groups:
109+
security:
110+
applies-to: "security-updates"
111+
patterns: ["*"]
101112
cooldown:
102113
default-days: 7
103114

104115
- package-ecosystem: "npm"
105116
directory: ".github/actions"
106117
schedule:
107118
interval: "daily"
119+
groups:
120+
security:
121+
applies-to: "security-updates"
122+
patterns: ["*"]
108123
open-pull-requests-limit: 10
109124
versioning-strategy: increase
110125
cooldown:
@@ -115,6 +130,9 @@ updates:
115130
schedule:
116131
interval: "daily"
117132
groups:
133+
security:
134+
applies-to: "security-updates"
135+
patterns: ["*"]
118136
storybook:
119137
patterns:
120138
- "@storybook/*"
@@ -142,6 +160,10 @@ updates:
142160
labels:
143161
- npm
144162
- dependabot
163+
groups:
164+
security:
165+
applies-to: "security-updates"
166+
patterns: ["*"]
145167
versioning-strategy: increase
146168
cooldown:
147169
default-days: 7
@@ -153,6 +175,10 @@ updates:
153175
labels:
154176
- npm
155177
- dependabot
178+
groups:
179+
security:
180+
applies-to: "security-updates"
181+
patterns: ["*"]
156182
open-pull-requests-limit: 10
157183
versioning-strategy: increase
158184
cooldown:

‎.github/workflows/superset-docs-deploy.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ jobs:
141141
yarn install --check-cache
142142
- name: Download database diagnostics (if triggered by integration tests)
143143
if: github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success'
144-
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
144+
uses: dawidd6/action-download-artifact@d63b86af1b34672e53c440b1b83979861906bad7 # v24
145145
continue-on-error: true
146146
with:
147147
workflow: superset-python-integrationtest.yml
@@ -150,7 +150,7 @@ jobs:
150150
path: docs/src/data/
151151
- name: Try to download latest diagnostics (for push/dispatch triggers)
152152
if: github.event_name != 'workflow_run'
153-
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
153+
uses: dawidd6/action-download-artifact@d63b86af1b34672e53c440b1b83979861906bad7 # v24
154154
continue-on-error: true
155155
with:
156156
workflow: superset-python-integrationtest.yml

‎.github/workflows/superset-docs-verify.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
run: |
141141
yarn install --check-cache
142142
- name: Download database diagnostics from integration tests
143-
uses: dawidd6/action-download-artifact@b6e2e70617bc3265edd6dab6c906732b2f1ae151 # v21
143+
uses: dawidd6/action-download-artifact@d63b86af1b34672e53c440b1b83979861906bad7 # v24
144144
with:
145145
workflow: superset-python-integrationtest.yml
146146
run_id: ${{ github.event.workflow_run.id }}

‎UPDATING.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ assists people when migrating to a new version.
2525
## Next
2626

2727
- `SAMPLES_ROW_LIMIT` is now the default for `/datasource/samples` requests without a valid explicit `per_page`, rather than a hard per-request ceiling; explicit limits are honored up to the existing global row-limit ceiling, matching `/chart/data` SAMPLES requests.
28+
- The `cockroachdb` extra (`pip install apache-superset[cockroachdb]`) now installs `sqlalchemy-cockroachdb` instead of the abandoned `cockroachdb` package, whose SQLAlchemy dialect could not be imported under SQLAlchemy 2.0. Existing environments with the old package installed should `pip uninstall cockroachdb && pip install sqlalchemy-cockroachdb` (or simply reinstall the extra) to restore CockroachDB connectivity.
2829

2930
### MCP tool results preserve stored string values
3031

‎docs/admin_docs/configuration/alerts-reports.mdx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ Users can configure automated alerts and reports to send dashboards or charts to
1414

1515
Alerts and reports are disabled by default. To turn them on, you'll need to change configuration settings and install a suitable headless browser in your environment.
1616

17+
## Content Format Options
18+
19+
When scheduling an alert or report, you can choose the format used to deliver the dashboard or chart:
20+
21+
- **PDF** – a full-page screenshot rendered as a PDF attachment. Available for both dashboards and charts.
22+
- **PNG** – a screenshot delivered as an attachment. Emails embed the image inline in the message body; Slack and webhook recipients receive it as an uploaded file. Available for both dashboards and charts.
23+
- **CSV** – chart data attached as a `.csv` file. Available for charts only.
24+
- **XLSX (Excel)** – chart data attached as a `.xlsx` file. Available for charts only. If the chart's data spans multiple server-paginated files, email delivery detects the bundle and renames the attachment to `.zip`; Slack and webhook deliveries always name the file with an `.xlsx` extension even when the contents are a multi-file ZIP archive.
25+
- **Text** – chart data embedded directly in the email or Slack message body. Available only for charts using a text-based visualization type (e.g. Table, Pivot Table, Paired t-test).
26+
27+
Dashboard reports and alerts are limited to the PDF and PNG formats; the CSV, XLSX, and Text options are only available when scheduling a report or alert for an individual chart.
28+
29+
For alerts (not scheduled reports), PNG/PDF screenshots and chart CSV/XLSX data are only generated when the `ALERTS_ATTACH_REPORTS` [feature flag](/admin-docs/configuration/configuring-superset#feature-flags) is enabled (the default); with it disabled, an alert notification is still sent, but without the attachment.
30+
1731
## Requirements
1832

1933
### Commons

‎docs/admin_docs/configuration/cache.mdx‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ value defined in `DATA_CACHE_CONFIG`.
7676
Note, that by setting the cache timeout to `-1`, caching for charting data can be disabled, either
7777
per chart, dataset or database, or by default if set in `DATA_CACHE_CONFIG`.
7878

79+
Native filter option queries (the dropdown values for native filters) go through this same
80+
chart-data cache, but their freshness needs often differ from regular chart queries, especially for
81+
datasets whose visible values change frequently, including RLS-constrained datasets. Set
82+
`NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT` in `superset_config.py` to give these queries a dedicated
83+
timeout, checked before the chart/dataset/database chain and the `DATA_CACHE_CONFIG` default above:
84+
85+
```python
86+
NATIVE_FILTER_OPTIONS_CACHE_TIMEOUT = 60 # seconds
87+
```
88+
89+
- `None` (default): native filter option queries fall through to the normal
90+
chart/dataset/database/`DATA_CACHE_CONFIG` resolution chain.
91+
- `-1`: disables caching for native filter option queries entirely.
92+
- `0`: passed directly to the cache backend; behavior is backend-specific, so use `-1` if the intent
93+
is to disable caching.
94+
- A positive integer: cache native filter option queries for that many seconds.
95+
96+
This setting only applies to requests detected as native filter option queries. It takes precedence
97+
over the per-chart/dataset/database timeouts, but not over an explicit per-request
98+
`custom_cache_timeout` override (e.g. "Force refresh").
99+
79100
## Limiting Cached Result Size
80101

81102
Very large chart or SQL query results can flood the cache backend (Redis/Memcached), evicting many

‎docs/admin_docs/configuration/importing-exporting-datasources.mdx‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ The optional username flag **-u** sets the user used for the datasource import.
8383
superset import_datasources -p <path / filename> -u 'admin'
8484
```
8585

86+
## Importing a Directory of Assets
87+
88+
The `import_directory` command imports a directory of exported assets (databases, datasets,
89+
dashboards, charts) in the same layout produced by the ZIP-based export. Saved queries and tags
90+
included in a full export are not imported by this command:
91+
92+
```bash
93+
superset import_directory <path / directory>
94+
```
95+
96+
As with `import_datasources`, the optional username flag **-u** sets the user assigned as the
97+
owner of the imported assets. The default is 'admin'. Example:
98+
99+
```bash
100+
superset import_directory <path / directory> -u 'admin'
101+
```
102+
103+
If the specified user does not exist, the command fails immediately with an error rather than
104+
importing the assets without an owner.
105+
86106
## Dashboard Import Overwrite Behavior
87107

88108
When importing a dashboard ZIP with the **overwrite** option enabled, any existing charts that are part of the dashboard are **replaced** rather than duplicated. This applies to:

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ All MCP settings go in `superset_config.py`. Defaults are defined in `superset/m
505505
| `MCP_DEV_USERNAME` | -- | Superset username for development mode (no auth) |
506506
| `MCP_RBAC_ENABLED` | `True` | Enforce Superset's role-based access control on MCP tool calls. When `True`, each tool checks that the authenticated user has the required FAB permission before executing. Disable only for testing or trusted-network deployments. |
507507
| `MCP_DISABLED_TOOLS` | `set()` | Set of tool names to remove from the MCP server at startup. Disabled tools are never advertised to AI clients during tool discovery. Useful when a custom extension tool should replace a built-in Superset tool. See [Disabling built-in tools](#disabling-built-in-tools). |
508+
| `MCP_DISABLED_CHART_PLUGINS` | `frozenset()` | Set of chart type plugin names (e.g. `"handlebars"`) to hide from `generate_chart`. Does not affect `get_chart_type_schema`. See [Disabling chart type plugins](#disabling-chart-type-plugins). |
509+
| `MCP_CHART_PLUGIN_ENABLED_FUNC` | `None` | Callable `(chart_type: str) -> bool` evaluated per registry lookup for dynamic enable/disable decisions. Takes precedence over `MCP_DISABLED_CHART_PLUGINS` when set. See [Disabling chart type plugins](#disabling-chart-type-plugins). |
508510

509511
### Authentication
510512

@@ -893,6 +895,39 @@ MCP_DISABLED_TOOLS = {"extensions.myorg.myextension.some_tool"}
893895
Specifying a tool name that does not exist logs a warning at startup and is otherwise ignored — it will not prevent the server from starting.
894896
:::
895897

898+
## Disabling chart type plugins
899+
900+
The `generate_chart` tool dispatches per chart type (`xy`, `table`, `pie`, `pivot_table`, `mixed_timeseries`, `handlebars`, `big_number`, `histogram`, `box_plot`, `waterfall`) to a registered chart type plugin. Two settings let operators enable or disable individual chart type plugins at runtime, without a code deploy.
901+
902+
### Static deny-list
903+
904+
Set `MCP_DISABLED_CHART_PLUGINS` in your `superset_config.py` to a set of chart type names:
905+
906+
```python
907+
# superset_config.py
908+
909+
# Emergency kill switch: hide "handlebars" from all callers
910+
MCP_DISABLED_CHART_PLUGINS = {"handlebars"}
911+
```
912+
913+
Disabled chart types stay registered but are filtered out at lookup time: they're never listed in `generate_chart`'s supported chart types, and `generate_chart` calls for them are rejected. `get_chart_type_schema` consults its own static schema/example map rather than the registry filter, so a disabled chart type's schema remains queryable through that tool even though `generate_chart` will reject it.
914+
915+
### Dynamic predicate
916+
917+
For per-request control (A/B tests, gradual rollout, entitlement checks), set `MCP_CHART_PLUGIN_ENABLED_FUNC` to a callable. It's evaluated as `enabled_func(chart_type: str) -> bool` on every registry lookup, and it takes precedence over `MCP_DISABLED_CHART_PLUGINS` when set:
918+
919+
```python
920+
# superset_config.py
921+
from flask import g
922+
923+
924+
def MCP_CHART_PLUGIN_ENABLED_FUNC(chart_type: str) -> bool:
925+
flags = getattr(g, "feature_flags", {})
926+
return flags.get(f"mcp_chart_{chart_type}", True)
927+
```
928+
929+
The callable must be cheap and in-process (consult already-loaded feature flags or request-local context) -- do not perform network I/O per call. If it raises, the registry fails closed (the plugin is hidden) and logs a warning.
930+
896931
## Security Best Practices
897932

898933
- **Use TLS** for all production MCP endpoints -- place the server behind a reverse proxy with HTTPS

‎docs/admin_docs/configuration/theming.mdx‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,27 @@ THEME_DARK = {
8888
# - OS preference detection is automatically enabled
8989
```
9090

91+
### Default Theme Mode
92+
93+
By default, Superset mimics the visitor's OS/browser preference (light or dark) for
94+
sessions that don't have a saved user preference. Use `THEME_DEFAULT_MODE` to override
95+
that starting point instance-wide for the standard application:
96+
97+
```python
98+
# Default theme mode for sessions without a saved user preference.
99+
# One of "default" (always light), "dark" (always dark), or "system" (mimic OS preference).
100+
THEME_DEFAULT_MODE = "dark"
101+
```
102+
103+
- `"system"` (the default) preserves the existing behavior of following the OS/browser
104+
preference, provided a dark theme is configured (`THEME_DARK` is not `None`). If no dark
105+
theme is available, Superset always starts in light mode regardless of this setting.
106+
- `"default"` or `"dark"` forces that starting mode for first-time visitors; users can still switch themes manually afterward if both `THEME_DEFAULT` and `THEME_DARK` are available.
107+
- A user's own saved preference, once they toggle the theme switcher, always takes precedence over `THEME_DEFAULT_MODE`.
108+
- `THEME_DEFAULT_MODE` has no effect on embedded dashboards: the embed SDK sets the
109+
starting mode via its own `themeMode` URL parameter, which takes precedence and falls
110+
back to light mode when the parameter is absent.
111+
91112
### App Branding
92113

93114
The application name shown in the browser title bar and navigation can be

‎docs/admin_docs/security/security.mdx‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,42 @@ Each subject in the response includes flat scalar ids (`user_id`, `role_id`, `gr
243243
than a nested object, so callers can match directly on whichever id they already have — only the
244244
id field matching the subject's `type` is populated; the others are `null`.
245245

246+
#### Extending Editorship with EXTRA_EDITORS_RESOLVER
247+
248+
Deployments that grant edit access to a dashboard or chart through a mechanism outside
249+
Superset's own Subject-based `editors` list — for example, a folder-permission system or an
250+
internal directory service — can plug that logic in with `EXTRA_EDITORS_RESOLVER`:
251+
252+
```python
253+
def extra_editors_resolver(resource):
254+
# `resource` is the Dashboard or Slice instance being checked.
255+
# Return Subject instances, raw subject ids, or dicts with an `id` key.
256+
return [...]
257+
258+
259+
EXTRA_EDITORS_RESOLVER = extra_editors_resolver
260+
```
261+
262+
The resolver's result is unioned with the resource's own `editors` for editorship checks: it
263+
feeds `is_editor`, `raise_for_editorship`, save-as, and soft-delete restore. When
264+
`EXTRA_EDITORS_RESOLVER` is configured, the usual lockout-prevention behavior — automatically
265+
re-adding a non-admin who removes themselves from a resource's editors — is skipped, since the
266+
deployment has its own way of keeping the resource editable. This skip is global to the setting,
267+
not per-resource: it still applies on a resource where the resolver currently returns no
268+
subjects, so a resolver that can't guarantee an alternate editor for every resource can let the
269+
last editor remove themselves and leave it uneditable by non-admins.
270+
271+
Resolved subject ids are also surfaced as `extra_editors` in the chart and dashboard `GET`
272+
responses, so API clients can distinguish resolver-granted editorship from the resource's own
273+
`editors` list. This field is attached after serialization and isn't part of the OpenAPI response
274+
schema, so generated API clients won't see it as a typed field.
275+
276+
Because the resolver is arbitrary per-deployment Python rather than a SQL-expressible condition,
277+
editorship it grants cannot be reflected in list-view filtering (for example, the soft-deleted
278+
archive is scoped to editors via a SQL query). It does still run once per row on chart and
279+
dashboard list responses to populate `extra_editors`, so a slow or unavailable external resolver
280+
affects ordinary list requests, not just direct per-object checks.
281+
246282
### Dashboard Access Control
247283

248284
Access to dashboards is managed via editors (subjects that have edit permissions to the dashboard).
@@ -583,6 +619,28 @@ SELECT * FROM (
583619
queries run against tables that have associated datasets with RLS filters will then have
584620
the appropriate predicates injected automatically.
585621

622+
#### RLS Indicator in the Dataset List and Explore
623+
624+
When a dataset has one or more RLS filters that apply to it, Superset shows a lock
625+
icon badge next to the dataset name in the **Datasets** list and next to the dataset
626+
selector in **Explore**. Hovering over the badge shows a tooltip listing each
627+
applicable filter's name, filter type (Regular or Base), group key (if any), assigned
628+
subjects (labeled "Roles" in the tooltip, but may include users and groups too), and
629+
clause.
630+
631+
This badge also surfaces filters that are inherited from the physical tables
632+
referenced by a virtual (SQL-based) dataset, as described above. Inherited filters
633+
are marked "from underlying table" in the tooltip, and a summary note is shown
634+
whenever any of the listed filters are inherited rather than assigned directly to
635+
the dataset. Inherited-filter detection depends on Superset's SQL parser being able
636+
to identify the referenced tables and match them to a physical dataset by name,
637+
schema, and database, so it's best-effort: unparseable or unmatched references won't
638+
surface a filter on the badge even if one would apply at query time.
639+
640+
The badge is a visibility aid only — it does not change which filters are applied to
641+
a query. Use the RLS REST API described below if you need to confirm exactly which
642+
filters affect a dataset.
643+
586644
#### Checking RLS Filters via the API
587645

588646
You can use the RLS REST API to audit which filters are configured and which datasets

0 commit comments

Comments
 (0)