blob: 2815303bcbd67cdc80fc7ecebef09198ab03b4d0 [file]
---
title: Feature Flags
hide_title: true
sidebar_position: 2
version: 1
---
import featureFlags from '@site/static/feature-flags.json';
export const FlagTable = ({ flags }) => (
<table>
<thead>
<tr>
<th>Flag</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{flags.map(flag => (
<tr key={flag.name}>
<td>
<code>{flag.name}</code>
</td>
<td>
<code>{flag.default ? 'True' : 'False'}</code>
</td>
<td>
{flag.description}
{flag.docs && (
<>
{' '}
(<a href={flag.docs}>docs</a>)
</>
)}
</td>
</tr>
))}
</tbody>
</table>
);
# Feature Flags
Superset uses feature flags to control the availability of features. Feature flags allow
gradual rollout of new functionality and provide a way to enable experimental features.
To enable a feature flag, add it to your `superset_config.py`:
```python
FEATURE_FLAGS = {
"ENABLE_TEMPLATE_PROCESSING": True,
}
```
## Runtime semantic-layer availability
`SEMANTIC_LAYERS` defaults to `False`. Both semantic-layer APIs are registered
at startup, and each request evaluates the active flag decision. Hosts can use
`IS_FEATURE_ENABLED_FUNC` and `GET_FEATURE_FLAGS_FUNC` to supply runtime decisions;
changing static configuration still requires a restart. Initialize permissions
with the normal `superset init` upgrade step. Enabling the runtime flag does not
grant permissions or require another permission sync.
When disabled, semantic API routes return 404. Semantic-view queries and metadata
return “Semantic layers are not enabled.” Saved charts remain listed, but their
data and cached images are unavailable; dashboards omit semantic-view dataset
metadata. Chart saves using semantic views are refused. Both fresh and cached dashboard screenshots/thumbnails return 404 if any chart
uses a semantic view. Legacy batch warm-up records a per-chart unavailable error
and continues processing. Dual-source MCP tools still serve ordinary datasets,
and unscoped metric listings omit semantic views. The semantic-only MCP tools
are unavailable, while chart listings mark affected charts with an
`unavailable_reason`. Ordinary dataset queries remain available, and semantic
import/export retains its existing feature-off rejection.
Background queries evaluate availability when the worker executes them. Browser
controls reflect the bootstrap flag on a full page load once the cached bootstrap
payload expires (up to 60 seconds with a configured `CACHE_CONFIG`); stale pages
still encounter server-side refusal. Providers must already be loaded through
`ENABLE_EXTENSIONS`, which remains a startup setting. During a rolling upgrade,
wait until every web and worker process has the runtime guards before enabling
the feature through a host hook. Disable the flag to roll back availability
without deleting stored semantic layers, views or charts.
## Lifecycle
Feature flags progress through lifecycle stages:
| Stage | Description |
| --------------- | ------------------------------------------------------------------------------ |
| **Development** | Experimental features under active development. May be incomplete or unstable. |
| **Testing** | Feature complete but undergoing testing. Usable but may contain bugs. |
| **Stable** | Production-ready features. Safe for all deployments. |
| **Deprecated** | Features scheduled for removal. Migrate away from these. |
---
## Development
These features are experimental and under active development. Use only in development environments.
<FlagTable flags={featureFlags.flags.development} />
---
## Testing
These features are complete but still being tested. They are usable but may have bugs.
<FlagTable flags={featureFlags.flags.testing} />
---
## Stable
These features are production-ready and safe to enable.
<FlagTable flags={featureFlags.flags.stable} />
---
## Deprecated
These features are scheduled for removal. Plan to migrate away from them.
<FlagTable flags={featureFlags.flags.deprecated} />
---
## Adding New Feature Flags
When adding a new feature flag to `superset/config.py`, include the following annotations:
```python
# Description of what the feature does
# @lifecycle: development | testing | stable | deprecated
# @docs: https://superset.apache.org/docs/... (optional)
# @category: runtime_config | path_to_deprecation (optional, for stable flags)
"MY_NEW_FEATURE": False,
```
This documentation is auto-generated from the annotations in
[config.py](https://github.com/apache/superset/blob/master/superset/config.py).